system-stats: Don't bother calling kill() after read_pidfile().
authorJustin Pettit <jpettit@nicira.com>
Sun, 13 Mar 2011 08:01:53 +0000 (00:01 -0800)
committerJustin Pettit <jpettit@nicira.com>
Sun, 13 Mar 2011 18:06:50 +0000 (11:06 -0700)
The function read_pidfile() will only return a PID if the process is
still running, so there's no reason to send a signal to check again.

Suggested-by: Andrew Evans <aevans@nicira.com>
vswitchd/system-stats.c

index 9c5a25c..b8f8d7e 100644 (file)
@@ -22,7 +22,6 @@
 #if HAVE_MNTENT_H
 #include <mntent.h>
 #endif
-#include <signal.h>
 #include <stdint.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -414,7 +413,7 @@ get_process_stats(struct shash *stats)
         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;
         }