Project

General

Profile

« Previous | Next » 

Revision 9262

lib/sh/util.sh: use set_fds() instead of `echo_eval exec` for clarity

View differences:

util.sh
298 298

  
299 299
## external commands
300 300

  
301
disable_logging() { echo_eval exec "$log_fd>/dev/null"; }
301
disable_logging() { set_fds "$log_fd>/dev/null"; }
302 302

  
303 303
function command() # usage: [cmd_log_fd=|1|2|#] command extern_cmd...
304 304
# to view only explicitly-displayed errors: explicit_errors_only=1 script...
......
309 309
	(
310 310
		# the following redirections must happen in exactly this order
311 311
		if test "$cmd_log_fd"; then
312
			echo_eval exec "$cmd_log_fd>$(if (log++; can_log); then \
312
			set_fds "$cmd_log_fd>$(if (log++; can_log); then \
313 313
			echo "&$log_fd"; else echo /dev/null; fi)"
314 314
		fi
315 315
		if test "$cmd_log_fd" != 2; then # fd 2 not used for logging

Also available in: Unified diff