X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=lib%2Fdaemon.php;h=359a4343b5efc2a7a2e7f0557715b53dc1fecbcb;hb=8deac7248e7db35515d7810491f9136deffa3098;hp=cf33d9b90d0f3ad77192eb15c26779dc2c8fdcd3;hpb=dfae116c47cc6c3bf6184b4c7ea01660d350eb5a;p=quix0rs-gnu-social.git diff --git a/lib/daemon.php b/lib/daemon.php index cf33d9b90d..359a4343b5 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() {