summaryrefslogtreecommitdiff
path: root/libiberty/pex-common.c
diff options
context:
space:
mode:
authorDJ Delorie <dj@redhat.com>2006-06-01 14:57:50 +0000
committerDJ Delorie <dj@redhat.com>2006-06-01 14:57:50 +0000
commit014a8caf46e8c0a25de0df38d859652ad6533f04 (patch)
tree445b4ff531f4dc525d54113e70eeb6a748de4df8 /libiberty/pex-common.c
parent8473f7a446bf3883ec64758583910ab497d4bc10 (diff)
downloadbinutils-gdb-014a8caf46e8c0a25de0df38d859652ad6533f04.tar.gz
merge from gcc
Diffstat (limited to 'libiberty/pex-common.c')
-rw-r--r--libiberty/pex-common.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/libiberty/pex-common.c b/libiberty/pex-common.c
index ebe8c437590..3daa638d402 100644
--- a/libiberty/pex-common.c
+++ b/libiberty/pex-common.c
@@ -142,12 +142,15 @@ temp_file (struct pex_obj *obj, int flags, char *name)
return name;
}
-/* Run a program. */
+
+/* As for pex_run (), but permits the environment for the child process
+ to be specified. */
const char *
-pex_run (struct pex_obj *obj, int flags, const char *executable,
- char * const * argv, const char *orig_outname, const char *errname,
- int *err)
+pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
+ char * const * argv, char * const * env,
+ const char *orig_outname, const char *errname,
+ int *err)
{
const char *errmsg;
int in, out, errdes;
@@ -296,8 +299,8 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
/* Run the program. */
- pid = obj->funcs->exec_child (obj, flags, executable, argv, in, out, errdes,
- &errmsg, err);
+ pid = obj->funcs->exec_child (obj, flags, executable, argv, env,
+ in, out, errdes, &errmsg, err);
if (pid < 0)
goto error_exit;
@@ -319,6 +322,17 @@ pex_run (struct pex_obj *obj, int flags, const char *executable,
return errmsg;
}
+/* Run a program. */
+
+const char *
+pex_run (struct pex_obj *obj, int flags, const char *executable,
+ char * const * argv, const char *orig_outname, const char *errname,
+ int *err)
+{
+ return pex_run_in_environment (obj, flags, executable, argv, NULL,
+ orig_outname, errname, err);
+}
+
/* Return a FILE pointer for a temporary file to fill with input for
the pipeline. */
FILE *