]> git.mxchange.org Git - friendica.git/commitdiff
Issue 3351: Check if resource was created
authorMichael <heluecht@pirati.ca>
Tue, 18 Apr 2017 17:17:15 +0000 (17:17 +0000)
committerMichael <heluecht@pirati.ca>
Tue, 18 Apr 2017 17:17:15 +0000 (17:17 +0000)
boot.php

index becb9bd570e895172d7a6e0465517eaccf4169c3..c44599477aafdc6a05a4e33a27d0edf9a299d77d 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -1367,11 +1367,15 @@ class App {
                $cmdline = implode($args, " ");
 
                if (get_config('system', 'proc_windows')) {
-                       proc_close(proc_open('cmd /c start /b ' . $cmdline, array(), $foo, dirname(__FILE__)));
+                       $resource = proc_open('cmd /c start /b ' . $cmdline, array(), $foo, dirname(__FILE__));
                } else {
-                       proc_close(proc_open($cmdline . " &", array(), $foo, dirname(__FILE__)));
+                       $resource = proc_open($cmdline . " &", array(), $foo, dirname(__FILE__));
                }
-
+               if (!is_resource($resource)) {
+                       logger('We got no resource for command '.$cmdline, LOGGER_DEBUG);
+                       return;
+               }
+               proc_close($resource);
        }
 
        /**