diff options
Diffstat (limited to 'contrib/package/freifunk-watchdog/src')
-rw-r--r-- | contrib/package/freifunk-watchdog/src/watchdog.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/contrib/package/freifunk-watchdog/src/watchdog.c b/contrib/package/freifunk-watchdog/src/watchdog.c index aea0516811..12d4badec3 100644 --- a/contrib/package/freifunk-watchdog/src/watchdog.c +++ b/contrib/package/freifunk-watchdog/src/watchdog.c @@ -111,7 +111,12 @@ static int find_process(const char *name) if( strstr(buffer, cmpname) == buffer ) { pid = atoi(entry->d_name); - break; + + /* Skip myself ... */ + if( pid == getpid() ) + pid = -1; + else + break; } } } @@ -339,7 +344,7 @@ int main(int argc, char *argv[]) /* Check if watchdog is running ... */ if( (argc > 1) && (strcmp(argv[1], "running") == 0) ) { - return (find_process(BINARY) >= 0); + return (find_process(BINARY) == -1); } /* Start daemon */ |