throw error on non-writable file

This commit is contained in:
botanic 2014-09-05 19:26:12 -07:00
parent d1a300e751
commit f9c4c3ac1f

View file

@ -27,7 +27,11 @@ class Sync{
if(!file_exists($pidfile)) {
$pid = getmypid();
$file = fopen($pidfile, 'w+');
if (!$file)
echo $pidfile.' is not writeable.';
error_log($pidfile.' is not writeable.');
throw new SystemExit();
}
fwrite($file, $pid);
fclose($file);