Rework the usage of the shell i/o during stop_packages(), fixes the "Syntax error: bad fd number" for the remaining people who still saw it on shutdown

This commit is contained in:
jim-p 2013-11-11 16:27:35 -05:00
parent 629f07c331
commit 6186cdc4be

View File

@ -1336,9 +1336,9 @@ function stop_packages() {
}
}
$shell = @popen("/bin/sh", "w");
if ($shell) {
foreach ($rcfiles as $rcfile => $number) {
foreach ($rcfiles as $rcfile => $number) {
$shell = @popen("/bin/sh", "w");
if ($shell) {
echo " Stopping {$rcfile}...";
if (!@fwrite($shell, "{$rcfile} stop >>/tmp/bootup_messages 2>&1")) {
if ($shell)
@ -1346,9 +1346,8 @@ function stop_packages() {
$shell = @popen("/bin/sh", "w");
}
echo "done.\n";
pclose($shell);
}
pclose($shell);
}
}