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.
This commit is contained in:
parent
e23559db8e
commit
5eccc0009b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=216439
@ -53,7 +53,6 @@ static const char rcsid[] =
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sysexits.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user