summaryrefslogtreecommitdiff
path: root/lib/daemon.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlezvous.ca>2008-10-04 20:08:51 -0400
committerEvan Prodromou <evan@controlezvous.ca>2008-10-04 20:08:51 -0400
commit9db29d42dd293f683beb6bf9b252828513c91683 (patch)
treeecc6cb81d54ded910ca14b140d1ff8e61e7409e6 /lib/daemon.php
parenta43d24b1b85f0dcc5faf29cc6cf432a3a3c02249 (diff)
more output in daemon.php
darcs-hash:20081005000851-34904-9d4db52b2b9aaf7567f3c0762a68c3e192740bdf.gz
Diffstat (limited to 'lib/daemon.php')
-rw-r--r--lib/daemon.php8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/daemon.php b/lib/daemon.php
index cf33d9b90..359a4343b 100644
--- a/lib/daemon.php
+++ b/lib/daemon.php
@@ -28,6 +28,7 @@ class Daemon {
function background() {
$pid = pcntl_fork();
if ($pid < 0) { # error
+ common_log(LOG_ERR, "Could not fork.");
return false;
} else if ($pid > 0) { # parent
common_log(LOG_INFO, "Successfully forked.");
@@ -63,12 +64,15 @@ class Daemon {
return false;
}
- file_put_contents($pidfilename, posix_getpid() . "\n");
+ return file_put_contents($pidfilename, posix_getpid() . "\n");
}
function clearPidFile() {
$pidfilename = $this->pidFilename();
- unlink($pidfilename);
+ if (!$pidfilename) {
+ return false;
+ }
+ return unlink($pidfilename);
}
function pidFilename() {