From 5b4755e9494b80f7b57c1515773991c962af0a2a Mon Sep 17 00:00:00 2001 From: Emmanuel Dreyfus Date: Fri, 27 Feb 2015 16:46:58 +0100 Subject: 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 Reviewed-on: http://review.gluster.org/9771 Tested-by: Gluster Build System Reviewed-by: Niels de Vos --- xlators/nfs/server/src/nlm4.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'xlators/nfs') 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 #include +#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); -- cgit