diff options
author | Hyejin Kim <hyejin0906.kim@samsung.com> | 2015-08-20 11:21:50 +0900 |
---|---|---|
committer | Hyejin Kim <hyejin0906.kim@samsung.com> | 2015-08-20 11:26:06 +0900 |
commit | b7d6e1f0e1a5df95e2950beaf9269932f895269a (patch) | |
tree | 95aa4c1e7f203834237bc2f72f5f8dc403c2b001 /lib/xwrap.c | |
parent | 3caa87343ee020f95f3bce84eab8664ac5cc1640 (diff) | |
parent | c55b214458bed6f6c6dc57e3fccfc8dc8558e7ee (diff) | |
download | toybox-b7d6e1f0e1a5df95e2950beaf9269932f895269a.tar.gz toybox-b7d6e1f0e1a5df95e2950beaf9269932f895269a.tar.bz2 toybox-b7d6e1f0e1a5df95e2950beaf9269932f895269a.zip |
Merge branch 'upstream' into tizensubmit/tizen/20150901.111553accepted/tizen/wearable/20150902.004616accepted/tizen/tv/20150902.004610accepted/tizen/mobile/20150902.004600
And version 0.6.0 applied
Change-Id: Iabc3dc2fc4bd984a114445d8b70df57eb43c3b16
Diffstat (limited to 'lib/xwrap.c')
-rw-r--r-- | lib/xwrap.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/xwrap.c b/lib/xwrap.c index 54f2cbb..8086282 100644 --- 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"); - if (toys.rebound) longjmp(*toys.rebound, 1); - else exit(toys.exitval); + exit(toys.exitval); } // Die unless we can allocate memory. @@ -136,7 +136,10 @@ void xexec(char **argv) if (CFG_TOYBOX && !CFG_TOYBOX_NORECURSE) toy_exec(argv); execvp(argv[0], argv); - perror_exit("exec %s", argv[0]); + perror_msg("exec %s", argv[0]); + toys.exitval = 127; + if (!CFG_TOYBOX_FORK) _exit(toys.exitval); + xexit(); } // Spawn child process, capturing stdin/stdout. |