From f9c4c3ac1f1c3b21a583d5b2eb068a96044aaea3 Mon Sep 17 00:00:00 2001 From: botanic Date: Fri, 5 Sep 2014 19:26:12 -0700 Subject: [PATCH] throw error on non-writable file --- code/web/private_php/ams/autoload/sync.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/code/web/private_php/ams/autoload/sync.php b/code/web/private_php/ams/autoload/sync.php index 47d6cb61b..2aaf9b069 100644 --- a/code/web/private_php/ams/autoload/sync.php +++ b/code/web/private_php/ams/autoload/sync.php @@ -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);