From 6a7dc0cd6550d397fde8d5873b66e084b70befe5 Mon Sep 17 00:00:00 2001 From: Brenden Matthews Date: Mon, 7 Jan 2019 19:21:34 -0500 Subject: [PATCH] Fix update_total_processes() missing return val. --- src/freebsd.cc | 8 +++++--- src/haiku.cc | 4 +++- src/netbsd.cc | 7 +++++-- src/openbsd.cc | 2 ++ src/solaris.cc | 5 ++++- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/freebsd.cc b/src/freebsd.cc index 8e2a5f83..008e3bee 100644 --- a/src/freebsd.cc +++ b/src/freebsd.cc @@ -33,9 +33,9 @@ #include #include #include +#include #include #include -#include #include #include @@ -371,7 +371,8 @@ int update_cpu_usage(void) { return 0; } -void free_cpu(struct text_object *) { /* no-op */ } +void free_cpu(struct text_object *) { /* no-op */ +} int update_load_average(void) { double v[3]; @@ -705,7 +706,8 @@ int get_entropy_poolsize(unsigned int *val) { return 1; } -void print_sysctlbyname(struct text_object *obj, char *p, unsigned int p_max_size) { +void print_sysctlbyname(struct text_object *obj, char *p, + unsigned int p_max_size) { u_int val[3] = {0}; char buf[256] = {""}; size_t len = sizeof(val); diff --git a/src/haiku.cc b/src/haiku.cc index 22f59033..202bd0a9 100644 --- a/src/haiku.cc +++ b/src/haiku.cc @@ -77,6 +77,7 @@ int update_net_stats() { int update_total_processes() { // TODO + return 0; } int update_running_processes() { @@ -143,7 +144,8 @@ int update_cpu_usage() { return 1; } -void free_cpu(struct text_object *) { /* no-op */ } +void free_cpu(struct text_object *) { /* no-op */ +} int update_load_average() { // TODO diff --git a/src/netbsd.cc b/src/netbsd.cc index 43b82ada..41a18bf6 100644 --- a/src/netbsd.cc +++ b/src/netbsd.cc @@ -27,8 +27,8 @@ * */ -#include "net_stat.h" #include "netbsd.h" +#include "net_stat.h" static kvm_t *kd = nullptr; int kd_init = 0, nkd_init = 0; @@ -223,6 +223,8 @@ int update_total_processes() { } info.procs = n_processes; + + return 0; } void update_running_processes() { @@ -286,7 +288,8 @@ void update_cpu_usage() { oldtotal = total; } -void free_cpu(struct text_object *) { /* no-op */ } +void free_cpu(struct text_object *) { /* no-op */ +} void update_load_average() { double v[3]; diff --git a/src/openbsd.cc b/src/openbsd.cc index 69a8cfb0..d9ba9bd6 100644 --- a/src/openbsd.cc +++ b/src/openbsd.cc @@ -257,6 +257,8 @@ int update_total_processes() { kvm_getprocs(kd, KERN_PROC_ALL, 0, &n_processes); info.procs = n_processes; + + return 0; } void update_running_processes() { diff --git a/src/solaris.cc b/src/solaris.cc index a146dd52..5c2662a9 100644 --- a/src/solaris.cc +++ b/src/solaris.cc @@ -181,6 +181,8 @@ double get_acpi_temperature(int fd) { int update_total_processes(void) { kstat_named_t *knp = get_kstat("unix", -1, "system_misc", "nproc"); if (knp != nullptr) info.procs = knp->value.ui32; + + return 0; } void get_battery_stuff(char *buf, unsigned int n, const char *bat, int item) { @@ -314,7 +316,8 @@ int update_cpu_usage(void) { return 0; } -void free_cpu(struct text_object *) { /* no-op */ } +void free_cpu(struct text_object *) { /* no-op */ +} void update_proc_entry(struct process *p) { psinfo_t proc;