From 990d9d15db27f47d2a6cac306ab773d42427ade4 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Tue, 24 Aug 2004 20:58:12 +0000 Subject: r2023: If there's garbage in the pidfile, we should not panic but assume that no one else is around. We can't find the other guy anyway. Volker (This used to be commit bf8773b094d41941478f0164ce33838027fadc09) --- source3/lib/pidfile.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source3/lib/pidfile.c b/source3/lib/pidfile.c index 1a462bf128..20a8e82ce2 100644 --- a/source3/lib/pidfile.c +++ b/source3/lib/pidfile.c @@ -49,6 +49,13 @@ pid_t pidfile_pid(const char *name) } ret = atoi(pidstr); + + if (ret == 0) { + /* Obviously we had some garbage in the pidfile... */ + DEBUG(1, ("Could not parse contents of pidfile %s\n", + pidFile)); + goto noproc; + } if (!process_exists((pid_t)ret)) { goto noproc; -- cgit