From 1e8d12bb2a4b8f4ce269707a5d4d52800f6c4bf1 Mon Sep 17 00:00:00 2001 From: Darell Tan Date: Tue, 20 Sep 2011 00:45:46 +0800 Subject: Used kill() instead of getsid() to verify pid, as getsid() may not have been compiled into uClibc. --- mdns-repeater.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mdns-repeater.c b/mdns-repeater.c index 72ba37b..0853b20 100644 --- a/mdns-repeater.c +++ b/mdns-repeater.c @@ -223,8 +223,7 @@ static pid_t already_running() { count = fscanf(f, "%d", &pid); fclose(f); if (count == 1) { - // see if pid exists (works on daemonized instances only) - if (getsid(pid) > 0) + if (kill(pid, 0) == 0) return pid; } } -- cgit v1.2.3