aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog.txt4
-rw-r--r--ports/unix/guts/system.c22
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;
* }