Skip to content

Commit

Permalink
Fix update_total_processes() missing return val.
Browse files Browse the repository at this point in the history
  • Loading branch information
brndnmtthws committed Jan 8, 2019
1 parent 21b4a0a commit 6a7dc0c
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 7 deletions.
8 changes: 5 additions & 3 deletions src/freebsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
#include <sys/resource.h>
#include <sys/socket.h>
#include <sys/stat.h>
#include <sys/sysctl.h>
#include <sys/time.h>
#include <sys/types.h>
#include <sys/sysctl.h>
#include <sys/user.h>

#include <net/if.h>
Expand Down Expand Up @@ -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];
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 3 additions & 1 deletion src/haiku.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ int update_net_stats() {

int update_total_processes() {
// TODO
return 0;
}

int update_running_processes() {
Expand Down Expand Up @@ -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
Expand Down
7 changes: 5 additions & 2 deletions src/netbsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -223,6 +223,8 @@ int update_total_processes() {
}

info.procs = n_processes;

return 0;
}

void update_running_processes() {
Expand Down Expand Up @@ -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];
Expand Down
2 changes: 2 additions & 0 deletions src/openbsd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
5 changes: 4 additions & 1 deletion src/solaris.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6a7dc0c

Please sign in to comment.