mirror of
https://github.com/opnsense/src.git
synced 2026-06-14 19:20:18 -04:00
printf: fix regression after illumos merges.
The "bltin/bltin.h" wrappers do not support exit() and attempting to call it will exit sh completely. Note that errx() is acceptable but will always return with status 2. Reported by: jilles (and the testing framework) Fix by: jilles Pointyhat: pfg
This commit is contained in:
parent
0d1381bb56
commit
30238f4963
1 changed files with 5 additions and 3 deletions
|
|
@ -101,6 +101,8 @@ static void usage(void);
|
|||
|
||||
static const char digits[] = "0123456789";
|
||||
|
||||
static char end_fmt[1];
|
||||
|
||||
static int myargc;
|
||||
static char **myargv;
|
||||
static char **gargv;
|
||||
|
|
@ -171,11 +173,11 @@ main(int argc, char *argv[])
|
|||
fmt += 2;
|
||||
} else {
|
||||
fmt = printf_doformat(fmt, &rval);
|
||||
if (fmt == NULL) {
|
||||
if (fmt == NULL || fmt == end_fmt) {
|
||||
#ifdef SHELL
|
||||
INTON;
|
||||
#endif
|
||||
return (1);
|
||||
return (fmt == NULL ? 1 : rval);
|
||||
}
|
||||
end = 0;
|
||||
}
|
||||
|
|
@ -372,7 +374,7 @@ printf_doformat(char *fmt, int *rval)
|
|||
fputs(p, stdout);
|
||||
free(p);
|
||||
if (getout)
|
||||
exit(*rval);
|
||||
return (end_fmt);
|
||||
break;
|
||||
}
|
||||
case 'c': {
|
||||
|
|
|
|||
Loading…
Reference in a new issue