diff options
author | DJ Delorie <dj@redhat.com> | 2006-06-01 14:57:50 +0000 |
---|---|---|
committer | DJ Delorie <dj@redhat.com> | 2006-06-01 14:57:50 +0000 |
commit | 014a8caf46e8c0a25de0df38d859652ad6533f04 (patch) | |
tree | 445b4ff531f4dc525d54113e70eeb6a748de4df8 /libiberty/pex-djgpp.c | |
parent | 8473f7a446bf3883ec64758583910ab497d4bc10 (diff) | |
download | gdb-014a8caf46e8c0a25de0df38d859652ad6533f04.zip gdb-014a8caf46e8c0a25de0df38d859652ad6533f04.tar.gz gdb-014a8caf46e8c0a25de0df38d859652ad6533f04.tar.bz2 |
merge from gcc
Diffstat (limited to 'libiberty/pex-djgpp.c')
-rw-r--r-- | libiberty/pex-djgpp.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/libiberty/pex-djgpp.c b/libiberty/pex-djgpp.c index 17fbf2c..acaa4c4 100644 --- a/libiberty/pex-djgpp.c +++ b/libiberty/pex-djgpp.c @@ -45,7 +45,8 @@ extern int errno; static int pex_djgpp_open_read (struct pex_obj *, const char *, int); static int pex_djgpp_open_write (struct pex_obj *, const char *, int); static long pex_djgpp_exec_child (struct pex_obj *, int, const char *, - char * const *, int, int, int, + char * const *, char * const *, + int, int, int, const char **, int *); static int pex_djgpp_close (struct pex_obj *, int); static int pex_djgpp_wait (struct pex_obj *, long, int *, struct pex_time *, @@ -111,7 +112,8 @@ pex_djgpp_close (struct pex_obj *obj ATTRIBUTE_UNUSED, int fd) static long pex_djgpp_exec_child (struct pex_obj *obj, int flags, const char *executable, - char * const * argv, int in, int out, int errdes, + char * const * argv, char * const * env, + int in, int out, int errdes, const char **errmsg, int *err) { int org_in, org_out, org_errdes; @@ -196,8 +198,12 @@ pex_djgpp_exec_child (struct pex_obj *obj, int flags, const char *executable, } } - status = (((flags & PEX_SEARCH) != 0 ? spawnvp : spawnv) - (P_WAIT, executable, (char * const *) argv)); + if (env) + status = (((flags & PEX_SEARCH) != 0 ? spawnvpe : spawnve) + (P_WAIT, executable, argv, env)); + else + status = (((flags & PEX_SEARCH) != 0 ? spawnvp : spawnv) + (P_WAIT, executable, argv)); if (status == -1) { |