diff options
author | Renato Botelho <renato.botelho@bluepex.com> | 2010-09-28 10:19:40 -0300 |
---|---|---|
committer | Renato Botelho <renato.botelho@bluepex.com> | 2010-09-28 10:19:40 -0300 |
commit | 43652f2fecfeb7ed4de28d697d515197ff1e3100 (patch) | |
tree | 962805777516af930939b2a9194927108d8a8319 /etc/inc/util.inc | |
parent | ad9db2a956814c4e04188b177e37061e7b310472 (diff) | |
parent | 7eab33095e8f2293a43ec03c7c6bf002c084bdb2 (diff) | |
download | pfsense-43652f2fecfeb7ed4de28d697d515197ff1e3100.zip pfsense-43652f2fecfeb7ed4de28d697d515197ff1e3100.tar.gz |
Merge remote branch 'mainline/master' into inc
Diffstat (limited to 'etc/inc/util.inc')
-rw-r--r-- | etc/inc/util.inc | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/etc/inc/util.inc b/etc/inc/util.inc index a1a8762..a46fae3 100644 --- a/etc/inc/util.inc +++ b/etc/inc/util.inc @@ -140,13 +140,19 @@ function unlock($cfglckkey = 0) { function send_event($cmd) { global $g; - $fd = fsockopen($g['event_address']); - if ($fd) { - fwrite($fd, $cmd); - $resp = fread($fd, 4096); - if ($resp != "OK\n") - log_error("send_event: sent {$cmd} got {$resp}"); - fclose($fd); + $try = 0; + while ($try < 3) { + $fd = @fsockopen($g['event_address']); + if ($fd) { + fwrite($fd, $cmd); + $resp = fread($fd, 4096); + if ($resp != "OK\n") + log_error("send_event: sent {$cmd} got {$resp}"); + fclose($fd); + $try = 3; + } else + mwexec_bg("/usr/bin/nice -n20 /usr/local/sbin/check_reload_status"); + $try++; } } @@ -1043,7 +1049,7 @@ function safe_mkdir($path, $mode=0755) { global $g; if (!is_file($path) && !is_dir($path)) { - return @mkdir($path, $mode); + return @mkdir($path, $mode, true); } else { return false; } |