gifsicle: redirect stdout to /dev/null but keep stderr going to stdout

This commit is contained in:
Michael Foster 2013-08-04 16:32:36 -04:00
parent a3cf56a768
commit acfda35648
2 changed files with 5 additions and 4 deletions

View file

@ -1939,13 +1939,14 @@ function DNS($host) {
return $ip_addr;
}
function shell_exec_error($command) {
function shell_exec_error($command, $suppress_stdout = false) {
global $config, $debug;
if ($config['debug'])
$start = microtime(true);
$return = trim(shell_exec('PATH="' . escapeshellcmd($config['shell_path']) . ':$PATH";' . $command . ' 2>&1 && echo "TB_SUCCESS"'));
$return = trim(shell_exec('PATH="' . escapeshellcmd($config['shell_path']) . ':$PATH";' .
$command . ' 2>&1 ' . ($suppress_stdout ? '> /dev/null ' : '') . '&& echo "TB_SUCCESS"'));
$return = preg_replace('/TB_SUCCESS$/', '', $return);
if ($config['debug']) {