summaryrefslogtreecommitdiffstats
path: root/xlators/nfs
diff options
context:
space:
mode:
authorEmmanuel Dreyfus <manu@netbsd.org>2015-02-27 16:46:58 +0100
committerNiels de Vos <ndevos@redhat.com>2015-02-28 00:54:41 -0800
commit5b4755e9494b80f7b57c1515773991c962af0a2a (patch)
treee9ef43bbe16edd30b7b506c2e6604fb4c0326c9d /xlators/nfs
parentb117d4d84becd25ef79c049ebf9b8ec6c4abca88 (diff)
NetBSD Portability fix: use pkill instead of killall
NetBSD does not have the killall command. BUG: 1129939 Change-Id: Ie022bfb7efd6288ab19050addcfbd2822fbc78c0 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/9771 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Niels de Vos <ndevos@redhat.com>
Diffstat (limited to 'xlators/nfs')
-rw-r--r--xlators/nfs/server/src/nlm4.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/nfs/server/src/nlm4.c b/xlators/nfs/server/src/nlm4.c
index b06a2524cb0..d1953815992 100644
--- a/xlators/nfs/server/src/nlm4.c
+++ b/xlators/nfs/server/src/nlm4.c
@@ -40,6 +40,12 @@
#include <rpc/xdr.h>
#include <statedump.h>
+#ifdef __NetBSD__
+#define KILLALL_CMD "pkill"
+#else
+#define KILLALL_CMD "killall"
+#endif
+
/* TODO:
* 1) 2 opens racing .. creating an fd leak.
* 2) use mempool for nlmclnt - destroy if no fd exists, create during 1st call
@@ -2455,7 +2461,7 @@ nlm4svc_init(xlator_t *nfsx)
if (ret <= 0) {
gf_log (GF_NLM, GF_LOG_WARNING, "unable to get pid of "
"rpc.statd from %s ", GF_RPC_STATD_PIDFILE);
- ret = runcmd ("killall", "-9", "rpc.statd", NULL);
+ ret = runcmd (KILLALL_CMD, "-9", "rpc.statd", NULL);
} else
kill (pid, SIGKILL);
@@ -2466,7 +2472,7 @@ nlm4svc_init(xlator_t *nfsx)
/* if ret == -1, do nothing - case either statd was not
* running or was running in valgrind mode
*/
- ret = runcmd ("killall", "-9", "rpc.statd", NULL);
+ ret = runcmd (KILLALL_CMD, "-9", "rpc.statd", NULL);
}
ret = unlink (GF_RPC_STATD_PIDFILE);