From b683a398af3500a579e31d0fc2e293dd936b2e8e Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 14 Dec 2010 18:23:15 +0000 Subject: When printf is being used as a sh(1) builtin, it can not call exit(3) as pointed out by jilles@ so revert to using return(), also change the return value back to 1 as requested by bde@. This is logically a revert of revision 216422. --- usr.bin/printf/printf.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 451b15b..e646f5d 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -53,7 +53,6 @@ static const char rcsid[] = #include #include #include -#include #include #ifdef SHELL @@ -123,7 +122,7 @@ main(int argc, char *argv[]) if (argc < 1) { usage(); - /* NOTREACHED */ + return (1); } #ifdef SHELL @@ -563,5 +562,4 @@ static void usage(void) { (void)fprintf(stderr, "usage: printf format [arguments ...]\n"); - exit(EX_USAGE); } -- cgit v1.1