aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/os/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/os/utils.c')
-rw-r--r--xorg-server/os/utils.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/xorg-server/os/utils.c b/xorg-server/os/utils.c
index a9433876b..522253a89 100644
--- a/xorg-server/os/utils.c
+++ b/xorg-server/os/utils.c
@@ -1308,10 +1308,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 */
@@ -1370,6 +1367,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;
}
@@ -1423,9 +1423,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;
}
@@ -1500,9 +1498,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
@@ -1531,10 +1527,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)