diff options
author | Peter Seebach <peter.seebach@windriver.com> | 2011-06-06 13:11:44 -0500 |
---|---|---|
committer | Peter Seebach <peter.seebach@windriver.com> | 2011-06-06 15:54:07 -0500 |
commit | 7e9680b24800ef7bfbe69f6763132ffe223afd30 (patch) | |
tree | c3fd5e90cd79c53d7a6c28e5722f6c7e9ce4d80a | |
parent | ae9c0b90171aaecbbfa074eb5e1d82a9a1e9ad8a (diff) | |
download | pseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.tar.gz pseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.tar.bz2 pseudo-7e9680b24800ef7bfbe69f6763132ffe223afd30.zip |
Improve system()
-rw-r--r-- | ChangeLog.txt | 4 | ||||
-rw-r--r-- | ports/unix/guts/system.c | 22 |
2 files changed, 6 insertions, 20 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 6e05bd0..953fb82 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,7 @@ +2011-06-06: + * (seebs) revise system() handler substantially. It now + pollutes the environment but works. + 2011-06-02: * (seebs) intercept system() so the pseudo environment is properly set for it. 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; * } |