shell/ash.c

Denys Vlasenko vda.linux at googlemail.com
Thu Jul 9 23:42:53 UTC 2009


On Monday 06 July 2009 23:37, Cristian Ionescu-Idbohrn wrote:
> Somewhere around line 1000.  I don't think we want shtree to output to
> stdout, do we? That would break a few things, and it does.  We might want
> it to go to stderr or tracefile, but defintely not stdout.
> 
> ---8<---
> static void
> showtree(union node *n)
> {
> 	trace_puts("showtree called\n");
> 	shtree(n, 1, NULL, stdout);
> }
> 
> #endif /* DEBUG */
> --->8---
> 
> And somewhere around line 11847:
> 
> ---8<---
> #if DEBUG
> 		showtree(n);
> #endif
> --->8---
> 
> We might want to do this instead:
> 
> #if DEBUG > 2
> 		if (debug && (n != NEOF))
> 			showtree(n);
> #endif
> 
> Without checking on 'debug', we always get output from showtree.  I don't
> think we want that.
> Without '(n != NEOF)' we may get segfaults.
> And 'DEBUG > 2' could be a good idea too.  What do you say?
> 
> The other thing is that there are a few places where %x should read 0x%x,
> maybe; at least for consistancy:
> 
> ->	254:	bb_error_msg("bug on %d: closing %d(%x)", \
> 	3821:	TRACE(("dowait(0x%x) called\n", wait_flags));
> 	3828:	TRACE(("wait returns pid=%d, status=0x%x, errno=%d(%s)\n",
> 	3846:					"from 0x%x to 0x%x\n",
> ->	3990:	TRACE(("showjobs(%x) called\n", mode));
> ->	4051:	TRACE(("getstatus: job %d, nproc %d, status %x, retval %x\n",
> 	5632:	TRACE(("evalbackcmd done: fd=%d buf=0x%x nleft=%d jp=0x%x\n",

Please send it as a patch.
--
vda


More information about the busybox mailing list