OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / libiberty / pex-msdos.c
index a7cc820..b5acd86 100644 (file)
@@ -55,8 +55,9 @@ static int pex_msdos_open (struct pex_obj *, const char *, int);
 static int pex_msdos_open (struct pex_obj *, const char *, int);
 static int pex_msdos_fdindex (struct pex_msdos *, int);
 static long pex_msdos_exec_child (struct pex_obj *, int, const char *,
-                                 char * const *, int, int, int,
-                                 const char **, int *);
+                                 char * const *, char * const *,
+                                 int, int, int, int,
+                                 int, const char **, int *);
 static int pex_msdos_close (struct pex_obj *, int);
 static int pex_msdos_wait (struct pex_obj *, long, int *, struct pex_time *,
                           int, const char **, int *);
@@ -73,6 +74,7 @@ const struct pex_funcs funcs =
   pex_msdos_wait,
   NULL, /* pipe */
   NULL, /* fdopenr */
+  NULL, /* fdopenw */
   pex_msdos_cleanup
 };
 
@@ -89,7 +91,7 @@ pex_init (int flags, const char *pname, const char *tempbase)
 
   ret = pex_init_common (flags, pname, tempbase, funcs);
 
-  ret->sysdep = xmalloc (sizeof (struct pex_msdos));
+  ret->sysdep = XNEW (struct pex_msdos);
   for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i)
     ret->files[i] = NULL;
   ret->statuses = NULL;
@@ -152,7 +154,8 @@ pex_msdos_close (struct pex_obj *obj, int fd)
 
 static long
 pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable,
-                     char * const * argv, int in, int out,
+                     char * const * argv, char * const * env, int in, int out,
+                     int toclose ATTRIBUTE_UNUSED,
                      int errdes ATTRIBUTE_UNUSED, const char **errmsg,
                      int *err)
 {
@@ -210,7 +213,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable,
       outfile = ms->files[outindex];
     }
 
-  scmd = xmalloc (strlen (program)
+  scmd = XNEWVEC (char, strlen (program)
                  + ((flags & PEXECUTE_SEARCH) != 0 ? 4 : 0)
                  + strlen (rf)
                  + strlen (infile)
@@ -269,7 +272,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable,
   /* Save the exit status for later.  When we are called, obj->count
      is the number of children which have executed before this
      one.  */
-  ms->statuses = xrealloc (ms->statuses, (obj->count + 1) * sizeof (int));
+  ms->statuses = XRESIZEVEC(int, ms->statuses, obj->count + 1);
   ms->statuses[obj->count] = status;
 
   return obj->count;