From 6c9810fc3cacfc034d31a4055d1d22495fa9b0f8 Mon Sep 17 00:00:00 2001 From: laf Date: Mon, 22 Jun 2015 22:55:32 +0100 Subject: [PATCH] Fix scrut issues --- includes/functions.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/includes/functions.php b/includes/functions.php index f158067ca2..43063fd52f 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -1285,7 +1285,6 @@ $process = proc_open($config['fping'] . ' -e -q ' .$params . ' ' .$host.' 2>&1', if (is_resource($process)) { - fwrite($pipes[0], $in); /* fwrite writes to stdin, 'cat' will immediately write the data from stdin * to stdout and blocks, when the stdout buffer is full. Then it will not * continue reading from stdin and php will block here. @@ -1293,16 +1292,15 @@ if (is_resource($process)) { fclose($pipes[0]); + $read = ''; while (!feof($pipes[1])) { $read .= fgets($pipes[1], 1024); } fclose($pipes[1]); - $return_value = proc_close($process); + proc_close($process); } - system("echo 'YEAH $read END\n' >> /tmp/testing"); - system("echo '". $config['fping'] ." -e -q $params $host' >> /tmp/testing"); preg_match('/[0-9]+\/[0-9]+\/[0-9]+%/', $read, $loss_tmp); preg_match('/[0-9\.]+\/[0-9\.]+\/[0-9\.]*$/', $read, $latency); $loss = preg_replace("/%/","",$loss_tmp[0]);