Project

General

Profile

« Previous | Next » 

Revision 9207

lib/sh/util.sh: shadow_fd(): don't require it to be run with log++ and instead let callers apply log++ if needed. in set_global_fds(), log++ can just be applied once for all the shadow_fd() calls.

View differences:

util.sh
319 319

  
320 320
shadow_fd() # usage: prefix=# src=fd dir='[<>]' shadow_fd
321 321
{
322
	log++; echo_func
322
	echo_func
323 323
	: "${prefix:?}" "${src:?}" "${dir:?}"
324 324
	dest="$prefix$src" noclobber=1 set_fd
325 325
}
......
330 330
# allows commands to access global stdin/stdout/stderr using fd 20/21/22
331 331
# this works even when /dev/tty isn't available
332 332
{
333
	log++; echo_func
333
	log++; echo_func; log++
334 334
	local prefix=2
335 335
	# ignore errors if a source fd isn't open
336 336
	src=0 dir='<' shadow_fd || true

Also available in: Unified diff