]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/misc.c (make_pid): A function to return the PID
authorPaul Smith <psmith@gnu.org>
Sat, 4 Jun 2022 20:48:26 +0000 (16:48 -0400)
committerPaul Smith <psmith@gnu.org>
Sat, 4 Jun 2022 21:04:38 +0000 (17:04 -0400)
* src/makeint.h: Declare it.
* src/commands.c (fatal_error_signal): Call it.

src/commands.c
src/makeint.h
src/misc.c

index cef51d359bce9eb96a0ff31e558a5aa09878f7b7..c048004b74ca8752f3dc66cff5948d4d582faf20 100644 (file)
@@ -30,10 +30,6 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 #else
 # define FILE_LIST_SEPARATOR ' '
 #endif
-
-#ifndef HAVE_UNISTD_H
-pid_t getpid ();
-#endif
 \f
 
 static unsigned long
@@ -599,7 +595,7 @@ fatal_error_signal (int sig)
 #else
   /* Signal the same code; this time it will really be fatal.  The signal
      will be unblocked when we return and arrive then to kill us.  */
-  if (kill (getpid (), sig) < 0)
+  if (kill (make_pid (), sig) < 0)
     pfatal_with_name ("kill");
 #endif /* not WINDOWS32 */
 #endif /* not Amiga */
index fce1afe15e150c030f190422825bfb6bcf610277..6bcb0c2c5e663393506f77bfa25611678a2e969c 100644 (file)
@@ -541,6 +541,7 @@ void die (int) NORETURN;
 void pfatal_with_name (const char *) NORETURN;
 void perror_with_name (const char *, const char *);
 #define xstrlen(_s) ((_s)==NULL ? 0 : strlen (_s))
+pid_t make_pid ();
 void *xmalloc (size_t);
 void *xcalloc (size_t);
 void *xrealloc (void *, size_t);
index 4f6bbf85ee14678595f84ed7ef74895120fc2d27..b03f2a3a163ebbc6d761c61c6cd8b2e2f4bd085e 100644 (file)
@@ -173,6 +173,16 @@ concat (unsigned int num, ...)
   return result;
 }
 \f
+
+#ifndef HAVE_UNISTD_H
+pid_t getpid ();
+#endif
+
+pid_t make_pid ()
+{
+  return getpid ();
+}
+
 /* Like malloc but get fatal error if memory is exhausted.  */
 /* Don't bother if we're using dmalloc; it provides these for us.  */