summaryrefslogtreecommitdiff
path: root/dmake
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2009-07-16 10:52:40 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2009-07-16 10:52:40 +0000
commit263df25c0b501a306f0d8111cf094c93ef1cff3a (patch)
tree99e8a5f1d6c35c82ad4a0b66d301179cf252608f /dmake
parent12981b955e57687d5ac3e8c40f7b602b65d7dba0 (diff)
CWS-TOOLING: integrate CWS mingwport21
2009-07-01 15:17:50 +0200 tono r273595 : i#102971: mingw port without solarbindir in PATH 2009-07-01 15:15:44 +0200 tono r273591 : i#90212: dmake not releasing file descriptor
Diffstat (limited to 'dmake')
-rw-r--r--dmake/unix/runargv.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c
index 5979d04bc546..4be342bbb273 100644
--- a/dmake/unix/runargv.c
+++ b/dmake/unix/runargv.c
@@ -553,8 +553,11 @@ char **cmd; /* Simulate a reference to *cmd. */
/* Restore stdout/stderr if needed. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
internal = 1;
@@ -593,8 +596,11 @@ char **cmd; /* Simulate a reference to *cmd. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
if(pid.pid == (DMHANDLE)-1) {
/* spawn failed */
@@ -649,8 +655,11 @@ char **cmd; /* Simulate a reference to *cmd. */
* failed. */
if( old_stdout != -1 ) {
dup2(old_stdout, 1);
- if( old_stderr != -1 )
+ close(old_stdout);
+ if( old_stderr != -1 ) {
dup2(old_stderr, 2);
+ close(old_stderr);
+ }
}
fprintf(stderr, "%s: Error executing '%s': %s",
Pname, argv[0], strerror(errno) );