Skip to content

Commit 6a7dc0c

Browse files
committed
Fix update_total_processes() missing return val.
1 parent 21b4a0a commit 6a7dc0c

File tree

5 files changed

+19
-7
lines changed

5 files changed

+19
-7
lines changed

src/freebsd.cc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@
3333
#include <sys/resource.h>
3434
#include <sys/socket.h>
3535
#include <sys/stat.h>
36+
#include <sys/sysctl.h>
3637
#include <sys/time.h>
3738
#include <sys/types.h>
38-
#include <sys/sysctl.h>
3939
#include <sys/user.h>
4040

4141
#include <net/if.h>
@@ -371,7 +371,8 @@ int update_cpu_usage(void) {
371371
return 0;
372372
}
373373

374-
void free_cpu(struct text_object *) { /* no-op */ }
374+
void free_cpu(struct text_object *) { /* no-op */
375+
}
375376

376377
int update_load_average(void) {
377378
double v[3];
@@ -705,7 +706,8 @@ int get_entropy_poolsize(unsigned int *val) {
705706
return 1;
706707
}
707708

708-
void print_sysctlbyname(struct text_object *obj, char *p, unsigned int p_max_size) {
709+
void print_sysctlbyname(struct text_object *obj, char *p,
710+
unsigned int p_max_size) {
709711
u_int val[3] = {0};
710712
char buf[256] = {""};
711713
size_t len = sizeof(val);

src/haiku.cc

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ int update_net_stats() {
7777

7878
int update_total_processes() {
7979
// TODO
80+
return 0;
8081
}
8182

8283
int update_running_processes() {
@@ -143,7 +144,8 @@ int update_cpu_usage() {
143144
return 1;
144145
}
145146

146-
void free_cpu(struct text_object *) { /* no-op */ }
147+
void free_cpu(struct text_object *) { /* no-op */
148+
}
147149

148150
int update_load_average() {
149151
// TODO

src/netbsd.cc

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
*
2828
*/
2929

30-
#include "net_stat.h"
3130
#include "netbsd.h"
31+
#include "net_stat.h"
3232

3333
static kvm_t *kd = nullptr;
3434
int kd_init = 0, nkd_init = 0;
@@ -223,6 +223,8 @@ int update_total_processes() {
223223
}
224224

225225
info.procs = n_processes;
226+
227+
return 0;
226228
}
227229

228230
void update_running_processes() {
@@ -286,7 +288,8 @@ void update_cpu_usage() {
286288
oldtotal = total;
287289
}
288290

289-
void free_cpu(struct text_object *) { /* no-op */ }
291+
void free_cpu(struct text_object *) { /* no-op */
292+
}
290293

291294
void update_load_average() {
292295
double v[3];

src/openbsd.cc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,8 @@ int update_total_processes() {
257257
kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes);
258258

259259
info.procs = n_processes;
260+
261+
return 0;
260262
}
261263

262264
void update_running_processes() {

src/solaris.cc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ double get_acpi_temperature(int fd) {
181181
int update_total_processes(void) {
182182
kstat_named_t *knp = get_kstat("unix", -1, "system_misc", "nproc");
183183
if (knp != nullptr) info.procs = knp->value.ui32;
184+
185+
return 0;
184186
}
185187

186188
void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) {
@@ -314,7 +316,8 @@ int update_cpu_usage(void) {
314316
return 0;
315317
}
316318

317-
void free_cpu(struct text_object *) { /* no-op */ }
319+
void free_cpu(struct text_object *) { /* no-op */
320+
}
318321

319322
void update_proc_entry(struct process *p) {
320323
psinfo_t proc;

0 commit comments

Comments
 (0)