summaryrefslogtreecommitdiff
path: root/lib/xwrap.c
diff options
context:
space:
mode:
authorYu Jiung <jiung.yu@samsung.com>2016-03-17 21:09:12 +0900
committerYu Jiung <jiung.yu@samsung.com>2016-03-17 21:09:12 +0900
commitf52e289a02c8ac3bab5c0ce9c7260ee653364e2f (patch)
tree79c081e962c0d911c4dcc198b707c3bde310044e /lib/xwrap.c
parent16d8d570a162fa40d5ed64798eb1c72e3288e3fc (diff)
downloadtoybox-f52e289a02c8ac3bab5c0ce9c7260ee653364e2f.tar.gz
toybox-f52e289a02c8ac3bab5c0ce9c7260ee653364e2f.tar.bz2
toybox-f52e289a02c8ac3bab5c0ce9c7260ee653364e2f.zip
Revert back to upstream 0.6.0 and remove all except for dhcp relatedsubmit/tizen/20160323.053424
Change-Id: Ide839cfefc7c4049715f86a2bf769c333175b2bf
Diffstat (limited to 'lib/xwrap.c')
-rwxr-xr-x[-rw-r--r--]lib/xwrap.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c
index 8086282..54f2cbb 100644..100755
--- a/lib/xwrap.c
+++ b/lib/xwrap.c
@@ -30,10 +30,10 @@ void xstrncat(char *dest, char *src, size_t size)
void xexit(void)
{
- if (toys.rebound) longjmp(*toys.rebound, 1);
if (fflush(NULL) || ferror(stdout))
if (!toys.exitval) perror_msg("write");
- exit(toys.exitval);
+ if (toys.rebound) longjmp(*toys.rebound, 1);
+ else exit(toys.exitval);
}
// Die unless we can allocate memory.
@@ -136,10 +136,7 @@ void xexec(char **argv)
if (CFG_TOYBOX && !CFG_TOYBOX_NORECURSE) toy_exec(argv);
execvp(argv[0], argv);
- perror_msg("exec %s", argv[0]);
- toys.exitval = 127;
- if (!CFG_TOYBOX_FORK) _exit(toys.exitval);
- xexit();
+ perror_exit("exec %s", argv[0]);
}
// Spawn child process, capturing stdin/stdout.