diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-27 23:50:30 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2006-08-27 23:50:30 +0000 |
commit | b470eeb2d8fc5d32c666974f7328313820597dd4 (patch) | |
tree | 605a7786db7fb3a02245d989ed8b13db7d8bdb92 /libiberty/pex-common.c | |
parent | e6c28517069c27ab2a3600b8b23c5816fd35ee30 (diff) | |
download | gcc-b470eeb2d8fc5d32c666974f7328313820597dd4.tar.gz |
PR driver/27622
* pex-common.h (struct pex_funcs): Add toclose parameter to
exec_child field.
* pex-common.c (pex_run_in_environment): Pass toclose to
exec_child.
* pex-djgpp.c (pex_djgpp_exec_child): Add toclose parameter.
* pex-unix.c (pex_unix_exec_child): Likewise.
* pex-msdos.c (pex_msdos_exec_child): Likewise.
* pex-win32.c (pex_win32_exec_child): Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@116494 138bc75d-0d04-0410-961f-82ee72b054a4
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; |