Revision 9198
Added by Aaron Marcuse-Kubitza over 11 years ago
lib/sh/util.sh | ||
---|---|---|
201 | 201 |
# `|| return` needed on Mac because of bug where -e doesn't apply to () |
202 | 202 |
function limit_stderr() |
203 | 203 |
{ |
204 |
local stderr_is_errors="${stderr_is_errors-1}" |
|
205 |
|
|
204 | 206 |
log++ # should only apply during this function for use by can_log |
205 |
if test "$stdout2stderr"; then |
|
206 |
local stderr_is_errors="${stderr_is_errors-1}" |
|
207 |
if ! can_log; then exec 1>/dev/null; else stdout2stderr; fi |
|
208 |
else |
|
209 |
if ! can_log; then exec 2>/dev/null; fi |
|
210 |
fi |
|
207 |
if ! can_log; then exec 2>/dev/null; fi |
|
208 |
if test "$stdout2stderr"; then stdout2stderr; fi |
|
211 | 209 |
} |
212 | 210 |
|
213 | 211 |
|
Also available in: Unified diff
lib/sh/util.sh: limit_stderr(): do stdout2stderr after limit_stderr to avoid having two similar `can_log ... >/dev/null` commands