projects
/
oweals
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
214511a
)
contrib/package: fix running check
author
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 4 May 2009 17:21:46 +0000
(17:21 +0000)
committer
Jo-Philipp Wich
<jow@openwrt.org>
Mon, 4 May 2009 17:21:46 +0000
(17:21 +0000)
contrib/package/freifunk-watchdog/src/watchdog.c
patch
|
blob
|
history
diff --git
a/contrib/package/freifunk-watchdog/src/watchdog.c
b/contrib/package/freifunk-watchdog/src/watchdog.c
index aea0516811bdd0f80fd518ad1b9e4e7409dbeea6..12d4badec35fc0ed3059d06f42211e9725528ddd 100644
(file)
--- 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 */