Update libiberty sources with changes in the gcc mainline.
[deliverable/binutils-gdb.git] / libiberty / pex-common.c
index 55b63ae33fe9840c280e3547c895260ee5d6f593..30cd9040d967d85d51c0f91142d4af782de197ad 100644 (file)
@@ -1,5 +1,5 @@
 /* Common code for executing a program in a sub-process.
-   Copyright (C) 2005, 2010 Free Software Foundation, Inc.
+   Copyright (C) 2005-2020 Free Software Foundation, Inc.
    Written by Ian Lance Taylor <ian@airs.com>.
 
 This file is part of the libiberty library.
@@ -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.029281 seconds and 4 git commands to generate.