add exitcode
This commit is contained in:
parent
5cc53af92d
commit
eadb18a335
3 changed files with 7 additions and 4 deletions
|
|
@ -376,6 +376,7 @@ extern int dec16(uchar*, int, char*, int);
|
||||||
extern int enc16(char*, int, uchar*, int);
|
extern int enc16(char*, int, uchar*, int);
|
||||||
extern int encodefmt(Fmt*);
|
extern int encodefmt(Fmt*);
|
||||||
extern int dirmodefmt(Fmt*);
|
extern int dirmodefmt(Fmt*);
|
||||||
|
extern int exitcode(char*);
|
||||||
extern void exits(char*);
|
extern void exits(char*);
|
||||||
extern double frexp(double, int*);
|
extern double frexp(double, int*);
|
||||||
extern ulong getcallerpc(void*);
|
extern ulong getcallerpc(void*);
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
void
|
void
|
||||||
_exits(char *s)
|
_exits(char *s)
|
||||||
{
|
{
|
||||||
if(s && *s)
|
if(s == 0 || *s == 0)
|
||||||
_exit(1);
|
|
||||||
_exit(0);
|
_exit(0);
|
||||||
|
_exit(exitcode(s));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -50,5 +50,7 @@ exits(char *s)
|
||||||
onex[i].f = 0;
|
onex[i].f = 0;
|
||||||
(*f)();
|
(*f)();
|
||||||
}
|
}
|
||||||
exit(s && *s ? 1 : 0);
|
if(s == 0 || *s == 0)
|
||||||
|
exit(0);
|
||||||
|
exit(exitcode(s));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue