aboutsummaryrefslogtreecommitdiff
path: root/libiberty/pex-common.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2006-08-28 00:56:25 +0000
committerDJ Delorie <dj@redhat.com>2006-08-28 00:56:25 +0000
commitcb6c09ace53de4a2952de95ff0f1f91e4809fbaa (patch)
treef1bcc51e7ead9bc22f4332bf59ddac7302656d6b /libiberty/pex-common.c
parent289397ccec5e89b311f173c9ea5df19cfb323587 (diff)
downloadfsf-binutils-gdb-cb6c09ace53de4a2952de95ff0f1f91e4809fbaa.zip
fsf-binutils-gdb-cb6c09ace53de4a2952de95ff0f1f91e4809fbaa.tar.gz
fsf-binutils-gdb-cb6c09ace53de4a2952de95ff0f1f91e4809fbaa.tar.bz2
merge from gcc
Diffstat (limited to 'libiberty/pex-common.c')
-rw-r--r--libiberty/pex-common.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c
index 3daa638..bb127f2 100644
--- a/libiberty/pex-common.c
+++ b/libiberty/pex-common.c
@@ -157,6 +157,7 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
char *outname;
int outname_allocated;
int p[2];
+ int toclose;
long pid;
in = -1;
@@ -297,10 +298,18 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
}
}
+ /* If we are using pipes, the child process has to close the next
+ input pipe. */
+
+ if ((obj->flags & PEX_USE_PIPES) == 0)
+ toclose = -1;
+ else
+ toclose = obj->next_input;
+
/* Run the program. */
pid = obj->funcs->exec_child (obj, flags, executable, argv, env,
- in, out, errdes, &errmsg, err);
+ in, out, errdes, toclose, &errmsg, err);
if (pid < 0)
goto error_exit;