aboutsummaryrefslogtreecommitdiffstats
path: root/ports
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2011-06-06 13:11:44 -0500
committerPeter Seebach <peter.seebach@windriver.com>2011-06-06 15:54:07 -0500
commit7e9680b24800ef7bfbe69f6763132ffe223afd30 (patch)
treec3fd5e90cd79c53d7a6c28e5722f6c7e9ce4d80a /ports
parentae9c0b90171aaecbbfa074eb5e1d82a9a1e9ad8a (diff)
downloadpseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.tar.gz
pseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.tar.bz2
pseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.zip
Improve system()
Diffstat (limited to 'ports')
-rw-r--r--ports/unix/guts/system.c22
1 files changed, 2 insertions, 20 deletions
diff --git a/ports/unix/guts/system.c b/ports/unix/guts/system.c
index 99b27c0..8b3607d 100644
--- a/ports/unix/guts/system.c
+++ b/ports/unix/guts/system.c
@@ -13,26 +13,8 @@
if (!command)
return 1;
- pid = wrap_fork();
-
- if (pid) {
- int status;
- waitpid(pid, &status, 0);
- if (WIFEXITED(status)) {
- rc = WEXITSTATUS(status);
- } else {
- /* we naively assume that either it exited or
- * got killed by a signal...
- */
- rc = WTERMSIG(status) + 128;
- }
- } else {
- /* this involves ANOTHER fork, but it's much, much,
- * simpler than trying to get all the details right.
- */
- rc = real_system(command);
- exit(rc);
- }
+ pseudo_setupenv();
+ rc = real_system(command);
/* return rc;
* }