diff options
author | Darell Tan <darell.tan@gmail.com> | 2011-09-20 00:45:46 +0800 |
---|---|---|
committer | Darell Tan <darell.tan@gmail.com> | 2011-09-20 00:45:46 +0800 |
commit | 1e8d12bb2a4b8f4ce269707a5d4d52800f6c4bf1 (patch) | |
tree | 8d3bc4ba75cfd1f029885a8eca8e45f9a60188a4 | |
parent | 9b3e6beee416d7c493e18e6daa930178a8026a9a (diff) | |
download | mdns-repeater-1e8d12bb2a4b8f4ce269707a5d4d52800f6c4bf1.tar.gz mdns-repeater-1e8d12bb2a4b8f4ce269707a5d4d52800f6c4bf1.zip |
Used kill() instead of getsid() to verify pid, as getsid() may not have been compiled into uClibc.
-rw-r--r-- | mdns-repeater.c | 3 |
1 files changed, 1 insertions, 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; } } |