X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=vswitchd%2Fsystem-stats.c;h=a3b4db44341c337cb94e2b65f83ed9726f1b4d79;hb=d308be1dff713f762e6ae18c1764115b866db5a8;hp=45b8cce64cf002145a427d4d7376e92cdc2f2f18;hpb=d98e60075528c3065ad453f7add4b30f22edcde3;p=openvswitch diff --git a/vswitchd/system-stats.c b/vswitchd/system-stats.c index 45b8cce6..a3b4db44 100644 --- a/vswitchd/system-stats.c +++ b/vswitchd/system-stats.c @@ -22,7 +22,6 @@ #if HAVE_MNTENT_H #include #endif -#include #include #include #include @@ -96,7 +95,11 @@ get_memory_stats(struct shash *stats) if (!LINUX) { unsigned int pagesize = get_page_size(); long int phys_pages = sysconf(_SC_PHYS_PAGES); +#ifdef _SC_AVPHYS_PAGES long int avphys_pages = sysconf(_SC_AVPHYS_PAGES); +#else + long int avphys_pages = 0; +#endif int mem_total, mem_used; if (pagesize <= 0 || phys_pages <= 0 || avphys_pages <= 0) { @@ -387,9 +390,9 @@ get_process_stats(struct shash *stats) struct dirent *de; DIR *dir; - dir = opendir(ovs_rundir); + dir = opendir(ovs_rundir()); if (!dir) { - VLOG_ERR_ONCE("%s: open failed (%s)", ovs_rundir, strerror(errno)); + VLOG_ERR_ONCE("%s: open failed (%s)", ovs_rundir(), strerror(errno)); return; } @@ -411,10 +414,10 @@ get_process_stats(struct shash *stats) continue; } - file_name = xasprintf("%s/%s", ovs_rundir, de->d_name); + file_name = xasprintf("%s/%s", ovs_rundir(), de->d_name); pid = read_pidfile(file_name); free(file_name); - if (pid < 0 || kill(pid, 0)) { + if (pid < 0) { continue; }