summaryrefslogtreecommitdiffstats
path: root/etc/inc/pkg-utils.inc
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:46 +0000
commit7aae18661f35ab1ac8adcde6db66e5a1b6b79947 (patch)
tree0b4218954d66836a901bf3c47a5c05161620f31f /etc/inc/pkg-utils.inc
parentafa76eff3d145d089e11b93d95a06d27f3249efa (diff)
downloadpfsense-7aae18661f35ab1ac8adcde6db66e5a1b6b79947.zip
pfsense-7aae18661f35ab1ac8adcde6db66e5a1b6b79947.tar.gz
Ticket #3139 try to detect if the popen is closed from an error
Diffstat (limited to 'etc/inc/pkg-utils.inc')
-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 bf99a64..25339eb 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";
}
@@ -1363,4 +1367,4 @@ function get_pkg_interfaces_select_source($include_localhost=false) {
}
return $ssifs;
}
-?> \ No newline at end of file
+?>
OpenPOWER on IntegriCloud