Fix PR63758 by using the _NSGetEnviron() API on Darwin
[deliverable/binutils-gdb.git] / libiberty / pex-common.c
index 55b63ae33fe9840c280e3547c895260ee5d6f593..146010a6fcac85bb7bf6964daed37321c4b30d3d 100644 (file)
@@ -267,7 +267,8 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
   if (out < 0)
     {
       out = obj->funcs->open_write (obj, outname,
-                                   (flags & PEX_BINARY_OUTPUT) != 0);
+                                   (flags & PEX_BINARY_OUTPUT) != 0,
+                                   (flags & PEX_STDOUT_APPEND) != 0);
       if (out < 0)
        {
          *err = errno;
@@ -319,8 +320,9 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
     }
   else
     {
-      errdes = obj->funcs->open_write (obj, errname, 
-                                      (flags & PEX_BINARY_ERROR) != 0);
+      errdes = obj->funcs->open_write (obj, errname,
+                                      (flags & PEX_BINARY_ERROR) != 0,
+                                      (flags & PEX_STDERR_APPEND) != 0);
       if (errdes < 0)
        {
          *err = errno;
@@ -623,12 +625,9 @@ pex_free (struct pex_obj *obj)
 
   if (obj->next_input_name_allocated)
     free (obj->next_input_name);
-  if (obj->children != NULL)
-    free (obj->children);
-  if (obj->status != NULL)
-    free (obj->status);
-  if (obj->time != NULL)
-    free (obj->time);
+  free (obj->children);
+  free (obj->status);
+  free (obj->time);
 
   if (obj->remove_count > 0)
     {
This page took 0.025883 seconds and 4 git commands to generate.