On Tue, Dec 14, 2010 at 12:21:35AM +0000, Xin LI wrote: > Author: delphij > Date: Tue Dec 14 00:21:34 2010 > New Revision: 216422 > URL: http://svn.freebsd.org/changeset/base/216422
> Log: > Make use of EX_USAGE for usage(). > Modified: > head/usr.bin/printf/printf.c > Modified: head/usr.bin/printf/printf.c > ============================================================================== > --- head/usr.bin/printf/printf.c Mon Dec 13 23:53:55 2010 > (r216421) > +++ head/usr.bin/printf/printf.c Tue Dec 14 00:21:34 2010 > (r216422) [...] > + exit(EX_USAGE); > } This does not work properly when printf is an sh builtin. The exit() call causes sh to exit entirely, rather than the builtin to return to the shell. The bug can be noticed easily because the test errors/option-error.0 (from tools/regression/bin/sh) fails. Please revert to returning the exit status from main(). Although I plan to clean up usr.bin/printf slightly after the n$ stuff is committed, I do not plan on adding things to sh that will allow exit() emulation in builtins. Other people have already said things about <sysexits.h>. -- Jilles Tjoelker _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"