X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fpex-msdos.c;h=ab4d736429e801bbb956fc06b315039a0a084121;hb=727fc41e077139570ea8b8ddfd6c546b2a55627c;hp=e2d76ee07a9468013454b65629066855955cd0ea;hpb=b109e79adcb0d7e31737de397f97fa41d1d4e528;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/pex-msdos.c b/libiberty/pex-msdos.c index e2d76ee07a..ab4d736429 100644 --- a/libiberty/pex-msdos.c +++ b/libiberty/pex-msdos.c @@ -16,8 +16,8 @@ Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with libiberty; see the file COPYING.LIB. If not, -write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ +write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, +Boston, MA 02110-1301, USA. */ #include "pex-common.h" @@ -54,11 +54,12 @@ struct pex_msdos 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 *); +static pid_t pex_msdos_exec_child (struct pex_obj *, int, const char *, + 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 *, +static int pex_msdos_wait (struct pex_obj *, pid_t, int *, struct pex_time *, int, const char **, int *); static void pex_msdos_cleanup (struct pex_obj *); @@ -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; @@ -150,9 +152,10 @@ pex_msdos_close (struct pex_obj *obj, int fd) /* Execute a child. */ -static long +static pid_t 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) @@ -232,7 +235,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable, free (scmd); free (rf); *errmsg = "cannot open temporary command file"; - return -1; + return (pid_t) -1; } for (i = 1; argv[i] != NULL; ++i) @@ -259,7 +262,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable, free (scmd); free (rf); *errmsg = "system"; - return -1; + return (pid_t) -1; } remove (rf); @@ -269,10 +272,10 @@ 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; + return (pid_t) obj->count; } /* Wait for a child process to complete. Actually the child process @@ -280,7 +283,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable, status. */ static int -pex_msdos_wait (struct pex_obj *obj, long pid, int *status, +pex_msdos_wait (struct pex_obj *obj, pid_t pid, int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED, const char **errmsg ATTRIBUTE_UNUSED, int *err ATTRIBUTE_UNUSED)