]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/makeint.h: Use pid_t to store PIDs, of int.
authorAron Barath <baratharon@caesar.elte.hu>
Mon, 9 Jul 2018 05:31:25 +0000 (07:31 +0200)
committerPaul Smith <psmith@gnu.org>
Fri, 3 Aug 2018 00:59:02 +0000 (20:59 -0400)
* src/commands.c (getpid): Ditto.
* src/job.h (*): Ditto.
* src/job.c (*): Ditto.
* src/main.c (main): Ditto.
* src/remote-cstms.c (start_remote_job): Ditto.
* src/remote-stub.c (start_remote_job): Ditto.

src/commands.c
src/job.c
src/job.h
src/main.c
src/makeint.h
src/remote-cstms.c
src/remote-stub.c

index fbf5714f56bd4cf8f940f5d334ec73275c91aaa9..49cd5e0e86a47baf8e0f2403441bd6bcb97df68c 100644 (file)
@@ -32,7 +32,7 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifndef HAVE_UNISTD_H
-int getpid ();
+pid_t getpid ();
 #endif
 \f
 
index 88539e8d228584bb8730ac57f1612755965cb183..47ce73db1f0f8a29f5690ab667319e8df77c168b 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -1379,7 +1379,8 @@ start_job_command (struct child *child)
   /* start_waiting_job has set CHILD->remote if we can start a remote job.  */
   if (child->remote)
     {
-      int is_remote, id, used_stdin;
+      int is_remote, used_stdin;
+      pid_t id;
       if (start_remote_job (argv, child->environment,
                             child->good_stdin ? 0 : get_bad_stdin (),
                             &is_remote, &id, &used_stdin))
@@ -2133,10 +2134,10 @@ start_waiting_jobs (void)
 
 /* EMX: Start a child process. This function returns the new pid.  */
 # if defined __EMX__
-int
+pid_t
 child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
 {
-  int pid;
+  pid_t pid;
   int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
   int fdout = FD_STDOUT;
   int fderr = FD_STDERR;
@@ -2231,14 +2232,14 @@ child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
 /* POSIX:
    Create a child process executing the command in ARGV.
    ENVP is the environment of the new program.  Returns the PID or -1.  */
-int
+pid_t
 child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
 {
   const int fdin = good_stdin ? FD_STDIN : get_bad_stdin ();
   int fdout = FD_STDOUT;
   int fderr = FD_STDERR;
   int r;
-  int pid;
+  pid_t pid;
 
   /* Divert child output if we want to capture it.  */
   if (out && out->syncout)
@@ -2283,7 +2284,7 @@ child_execute_job (struct output *out, int good_stdin, char **argv, char **envp)
 
 /* EMX: This function returns the pid of the child process.  */
 # ifdef __EMX__
-int
+pid_t
 # else
 void
 # endif
@@ -2359,7 +2360,7 @@ exec_command (char **argv, char **envp)
 #else  /* !WINDOWS32 */
 
 # ifdef __EMX__
-  int pid;
+  pid_t pid;
 # endif
 
   /* Be the user, permanently.  */
index 3bd2385a392cbc5f04531fa5709e7036baa6d878..afd9d8d8aa1b95547e6ac7ae15add905a53115ec 100644 (file)
--- a/src/job.h
+++ b/src/job.h
@@ -62,7 +62,7 @@ char **construct_command_argv (char *line, char **restp, struct file *file,
 #ifdef VMS
 int child_execute_job (struct child *child, char *argv);
 #else
-int child_execute_job (struct output *out, int good_stdin, char **argv, char **envp);
+pid_t child_execute_job (struct output *out, int good_stdin, char **argv, char **envp);
 #endif
 
 #ifdef _AMIGA
index 31b7eac5a040aebbc2ca9e8b72a4cfb2e305387f..eed4e8193a2dee6c178fadeb9e2f994c20eae277 100644 (file)
@@ -2472,7 +2472,7 @@ main (int argc, char **argv, char **envp)
                Therefore it may be the best solution simply to spawn the
                child process including all file handles and to wait for its
                termination. */
-            int pid;
+            pid_t pid;
             int r;
             pid = child_execute_job (NULL, 1, nargv, environ);
 
index fab20faac92cf0da053e159e22b66516513dc3d9..79b286cca2fe2254c78675f453a52d6189970d06 100644 (file)
@@ -707,7 +707,7 @@ vms_restore_symbol (const char *string);
 void remote_setup (void);
 void remote_cleanup (void);
 int start_remote_job_p (int);
-int start_remote_job (char **, char **, int, int *, int *, int *);
+int start_remote_job (char **, char **, int, int *, pid_t *, int *);
 int remote_status (int *, int *, int *, int);
 void block_remote_children (void);
 void unblock_remote_children (void);
index a123380297303cdea0895e3b581bfd329cbbf7d6..53535b5fdc59099b9a08f4dd5e82f8891470b562 100644 (file)
@@ -136,7 +136,7 @@ start_remote_job_p (int first_p)
 
 int
 start_remote_job (char **argv, char **envp, int stdin_fd,
-                  int *is_remote, int *id_ptr, int *used_stdin)
+                  int *is_remote, pid_t *id_ptr, int *used_stdin)
 {
   char waybill[MAX_DATA_SIZE], msg[128];
   struct hostent *host;
@@ -145,7 +145,7 @@ start_remote_job (char **argv, char **envp, int stdin_fd,
   int len;
   int retsock, retport, sock;
   Rpc_Stat status;
-  int pid;
+  pid_t pid;
 
   /* Create the return socket.  */
   retsock = Rpc_UdpCreate (True, 0);
index d63b81647bb7bd2134ec73d951a51dffdc9c8010..7a5173090e783687bab03415399aa44e1355db71 100644 (file)
@@ -53,7 +53,7 @@ start_remote_job_p (int first_p UNUSED)
 
 int
 start_remote_job (char **argv UNUSED, char **envp UNUSED, int stdin_fd UNUSED,
-                  int *is_remote UNUSED, int *id_ptr UNUSED,
+                  int *is_remote UNUSED, pid_t *id_ptr UNUSED,
                   int *used_stdin UNUSED)
 {
   return -1;