diff options
author | DJ Delorie <dj@delorie.com> | 2006-08-28 00:56:25 +0000 |
---|---|---|
committer | DJ Delorie <dj@delorie.com> | 2006-08-28 00:56:25 +0000 |
commit | ba6bca9bcc98d3b8e2b5186d44f3f9ea00878b0a (patch) | |
tree | 72649355b7c70b4e953d6fb302373fcf85e07d65 /libiberty/pex-common.c | |
parent | 4bcf3bb11fc423171e6e8e673be9b8eeccf74563 (diff) | |
download | gdb-ba6bca9bcc98d3b8e2b5186d44f3f9ea00878b0a.tar.gz |
merge from gccnickrob-async-20060828-mergepoint
Diffstat (limited to 'libiberty/pex-common.c')
-rw-r--r-- | libiberty/pex-common.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c index 3daa638d402..bb127f2ed77 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; |