diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/utils.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/os/utils.c b/os/utils.c index 3dfa8a43b..9d39f7016 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1280,10 +1280,7 @@ System(char *command) perror("signal"); return -1; } - -#ifdef DEBUG - ErrorF("System: `%s'\n", command); -#endif + DebugF("System: `%s'\n", command); switch (pid = fork()) { case -1: /* error */ @@ -1342,6 +1339,9 @@ Popen(char *command, char *type) /* Ignore the smart scheduler while this is going on */ old_alarm = OsSignal(SIGALRM, SIG_IGN); if (old_alarm == SIG_ERR) { + close(pdes[0]); + close(pdes[1]); + free(cur); perror("signal"); return NULL; } @@ -1395,9 +1395,7 @@ Popen(char *command, char *type) cur->next = pidlist; pidlist = cur; -#ifdef DEBUG - ErrorF("Popen: `%s', fp = %p\n", command, iop); -#endif + DebugF("Popen: `%s', fp = %p\n", command, iop); return iop; } @@ -1472,9 +1470,7 @@ Fopen(char *file, char *type) cur->next = pidlist; pidlist = cur; -#ifdef DEBUG - ErrorF("Fopen(%s), fp = %p\n", file, iop); -#endif + DebugF("Fopen(%s), fp = %p\n", file, iop); return iop; #else @@ -1503,10 +1499,7 @@ Pclose(pointer iop) int pstat; int pid; -#ifdef DEBUG - ErrorF("Pclose: fp = %p\n", iop); -#endif - + DebugF("Pclose: fp = %p\n", iop); fclose(iop); for (last = NULL, cur = pidlist; cur; last = cur, cur = cur->next) |