X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libiberty%2Fpex-msdos.c;h=fa0f40ac9edaad32e9834abf6d1cb94010a152b6;hb=ec240384701a1f12fe569206408a6df8fca9bce4;hp=2256117d1bb0cb7d5d20c1224b01827ee5371023;hpb=abf6a75b428517d9caaf9155212b0b10e0379a99;p=platform%2Fupstream%2Fbinutils.git diff --git a/libiberty/pex-msdos.c b/libiberty/pex-msdos.c index 2256117..fa0f40a 100644 --- a/libiberty/pex-msdos.c +++ b/libiberty/pex-msdos.c @@ -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 pid_t 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 }; @@ -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) { @@ -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); @@ -272,15 +275,15 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable, 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 has already completed, and we just need to return the exit status. */ -static int -pex_msdos_wait (struct pex_obj *obj, long pid, int *status, +static pid_t +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) @@ -307,10 +310,8 @@ pex_msdos_cleanup (struct pex_obj *obj) ms = (struct pex_msdos *) obj->sysdep; for (i = 0; i < PEX_MSDOS_FILE_COUNT; ++i) - if (msdos->files[i] != NULL) - free (msdos->files[i]); - if (msdos->statuses != NULL) - free (msdos->statuses); + free (msdos->files[i]); + free (msdos->statuses); free (msdos); obj->sysdep = NULL; }