]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2009-04-13 Ozkan Sezer <sezeroz@gmail.com>
authorktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Apr 2009 10:45:58 +0000 (10:45 +0000)
committerktietz <ktietz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 13 Apr 2009 10:45:58 +0000 (10:45 +0000)
        PR target/39397
        * pex-common.h (struct pex_obj): Store pid values as pid_t,
        not as long (members *children and (*wait))
        * pex-common.c (pex_run_in_environment): Likewise.
        * pex-win32.c (pex_win32_wait): Return pid_t and properly check
        returned pid value.
        * pex-djgpp.c (pex_djgpp_wait): Return pid_t.
        * pex-msdos.c (pex_msdos_wait): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146001 138bc75d-0d04-0410-961f-82ee72b054a4

libiberty/ChangeLog
libiberty/pex-common.c
libiberty/pex-common.h
libiberty/pex-djgpp.c
libiberty/pex-msdos.c
libiberty/pex-win32.c

index 2e0a27c66aa54416a73eb6d18e55658283de36aa..c58f63551420074f02c9c1ac2e430a2ea4159f26 100644 (file)
@@ -1,3 +1,14 @@
+2009-04-13  Ozkan Sezer  <sezeroz@gmail.com>
+
+        PR target/39397
+        * pex-common.h (struct pex_obj): Store pid values as pid_t,
+        not as long (members *children and (*wait))
+        * pex-common.c (pex_run_in_environment): Likewise.
+        * pex-win32.c (pex_win32_wait): Return pid_t and properly check
+        returned pid value.
+        * pex-djgpp.c (pex_djgpp_wait): Return pid_t.
+        * pex-msdos.c (pex_msdos_wait): Likewise.
+
 2009-04-07  Arnaud Patard <apatard@mandriva.com>
 
        * libiberty/configure.ac: Fix Linux/MIPS matching rule.
index 7f355365edafd192fa2a0d46f8a733ba95fda2ad..9a9fe2419570888171fc4460aa8665a10c6bfde3 100644 (file)
@@ -160,7 +160,7 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
   int outname_allocated;
   int p[2];
   int toclose;
-  long pid;
+  pid_t pid;
 
   in = -1;
   out = -1;
@@ -345,7 +345,7 @@ pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable,
     goto error_exit;
 
   ++obj->count;
-  obj->children = XRESIZEVEC (long, obj->children, obj->count);
+  obj->children = XRESIZEVEC (pid_t, obj->children, obj->count);
   obj->children[obj->count - 1] = pid;
 
   return NULL;
index 5b7bfcc03ee3bc23fde19f2ad984269c35bc4a04..af338e6a34b0b6cc26304906e2930b2269c948c8 100644 (file)
@@ -70,7 +70,7 @@ struct pex_obj
   /* Number of child processes.  */
   int count;
   /* PIDs of child processes; array allocated using malloc.  */
-  long *children;
+  pid_t *children;
   /* Exit statuses of child processes; array allocated using malloc.  */
   int *status;
   /* Time used by child processes; array allocated using malloc.  */
@@ -126,7 +126,7 @@ struct pex_funcs
      and time in *TIME (if it is not null).  CHILD is from fork.  DONE
      is 1 if this is called via pex_free.  ERRMSG and ERR are as in
      fork.  Return 0 on success, -1 on error.  */
-  int (*wait) (struct pex_obj *, pid_t /* child */, int * /* status */,
+  pid_t (*wait) (struct pex_obj *, pid_t /* child */, int * /* status */,
                struct pex_time * /* time */, int /* done */,
                const char ** /* errmsg */, int * /* err */);
   /* Create a pipe (only called if PEX_USE_PIPES is set) storing two
index bd279380daec881e2355a8dc337d3e08bf963923..0721139954ff993a0c872a5697b4d9c8bdba9eeb 100644 (file)
@@ -49,7 +49,7 @@ static pid_t pex_djgpp_exec_child (struct pex_obj *, int, const char *,
                                  int, int, int, int,
                                  const char **, int *);
 static int pex_djgpp_close (struct pex_obj *, int);
-static int pex_djgpp_wait (struct pex_obj *, pid_t, int *, struct pex_time *,
+static pid_t pex_djgpp_wait (struct pex_obj *, pid_t, int *, struct pex_time *,
                           int, const char **, int *);
 
 /* The list of functions we pass to the common routines.  */
@@ -276,7 +276,7 @@ pex_djgpp_exec_child (struct pex_obj *obj, int flags, const char *executable,
    has already completed, and we just need to return the exit
    status.  */
 
-static int
+static pid_t
 pex_djgpp_wait (struct pex_obj *obj, pid_t pid, int *status,
                struct pex_time *time, int done ATTRIBUTE_UNUSED,
                const char **errmsg ATTRIBUTE_UNUSED,
index ab4d736429e801bbb956fc06b315039a0a084121..4b77bf655fb5bc9145d5b69b71036968d7300b64 100644 (file)
@@ -59,7 +59,7 @@ static pid_t pex_msdos_exec_child (struct pex_obj *, int, const char *,
                                  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 *, pid_t, 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 *);
 
@@ -282,7 +282,7 @@ pex_msdos_exec_child (struct pex_obj *obj, int flags, const char *executable,
    has already completed, and we just need to return the exit
    status.  */
 
-static int
+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,
index 5897866347d7b1b08ac7d1e62a44349387a2d558..3f3775193664a13aa8bbf2cdf3d4c0d4e366dba1 100644 (file)
@@ -84,7 +84,7 @@ static pid_t pex_win32_exec_child (struct pex_obj *, int, const char *,
                                   int, int, int, int,
                                  const char **, int *);
 static int pex_win32_close (struct pex_obj *, int);
-static int pex_win32_wait (struct pex_obj *, pid_t, int *,
+static pid_t pex_win32_wait (struct pex_obj *, pid_t, int *,
                           struct pex_time *, int, const char **, int *);
 static int pex_win32_pipe (struct pex_obj *, int *, int);
 static FILE *pex_win32_fdopenr (struct pex_obj *, int, int);
@@ -705,7 +705,7 @@ spawn_script (const char *executable, char *const *argv,
                                     dwCreationFlags, si, pi);
                  if (executable1 != newex)
                    free ((char *) newex);
-                 if ((long) pid < 0)
+                 if (pid == (pid_t) -1)
                    {
                      newex = msys_rootify (executable1);
                      if (newex != executable1)
@@ -722,7 +722,7 @@ spawn_script (const char *executable, char *const *argv,
            }
        }
     }
-  if ((long) pid < 0)
+  if (pid == (pid_t) -1)
     errno = save_errno;
   return pid;
 }
@@ -840,7 +840,7 @@ pex_win32_exec_child (struct pex_obj *obj ATTRIBUTE_UNUSED, int flags,
    status == 3.  We fix the status code to conform to the usual WIF*
    macros.  Note that WIFSIGNALED will never be true under CRTDLL. */
 
-static int
+static pid_t
 pex_win32_wait (struct pex_obj *obj ATTRIBUTE_UNUSED, pid_t pid,
                int *status, struct pex_time *time, int done ATTRIBUTE_UNUSED,
                const char **errmsg, int *err)