aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Bachelier <laurent@bachelier.name>2010-04-20 12:06:46 +0200
committerLaurent Bachelier <laurent@bachelier.name>2010-04-20 12:06:46 +0200
commitfaa54d6ce66b8f42cd0eb9835e0f6c034e553c98 (patch)
treea74d087055c18c7742e0db6039d34d2ee6b8a70a
parentFixes diplay of uncaught exceptions (diff)
downloadsymfttpd-faa54d6ce66b8f42cd0eb9835e0f6c034e553c98.tar.xz
Validate PIDv1.0.0
-rwxr-xr-xspawn11
1 files changed, 7 insertions, 4 deletions
diff --git a/spawn b/spawn
index 1f22343..9cb1f2b 100755
--- a/spawn
+++ b/spawn
@@ -28,10 +28,13 @@ if (Argument::get('K', 'kill', false))
{
if (file_exists($options['pidfile']))
{
- $pid = trim(file_get_contents($options['pidfile']));
- posix_kill($pid, SIGTERM);
- echo 'Process '.$pid." killed\n";
- exit(0);
+ $pid = intval(trim(file_get_contents($options['pidfile'])));
+ if ($pid)
+ {
+ posix_kill($pid, SIGTERM);
+ echo 'Process '.$pid." killed\n";
+ exit(0);
+ }
}
else
{