summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2013-08-13 10:18:32 +0000
committerErmal <eri@pfsense.org>2013-08-13 10:18:32 +0000
commit61ef13853f8bd1c02e323b36973b581348ffb805 (patch)
tree47cffbf2ca7eb828165d99532aa707f3e109becb
parent1ca626e7b824cbff5d1aa87c4e416373fcc1a2d9 (diff)
downloadpfsense-61ef13853f8bd1c02e323b36973b581348ffb805.zip
pfsense-61ef13853f8bd1c02e323b36973b581348ffb805.tar.gz
Ticket #3139 try to detect if the popen is closed from an error
-rw-r--r--etc/inc/pkg-utils.inc8
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/inc/pkg-utils.inc b/etc/inc/pkg-utils.inc
index c71479c..437324c 100644
--- a/etc/inc/pkg-utils.inc
+++ b/etc/inc/pkg-utils.inc
@@ -1340,7 +1340,11 @@ function stop_packages() {
if ($shell) {
foreach ($rcfiles as $rcfile => $number) {
echo " Stopping {$rcfile}...";
- fwrite($shell, "{$rcfile} stop >>/tmp/bootup_messages 2>&1");
+ if (!@fwrite($shell, "{$rcfile} stop >>/tmp/bootup_messages 2>&1")) {
+ if ($shell)
+ pclose($shell);
+ $shell = @popen("/bin/sh", "w");
+ }
echo "done.\n";
}
@@ -1397,4 +1401,4 @@ function get_pkg_interfaces_select_source($include_localhost=false) {
}
return $ssifs;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud