mirror of
https://github.com/mirror/make.git
synced 2024-12-29 14:30:42 +08:00
* src/misc.c (make_pid): A function to return the PID
* src/makeint.h: Declare it. * src/commands.c (fatal_error_signal): Call it.
This commit is contained in:
parent
1c179f9636
commit
d444b87173
@ -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
|
||||
|
||||
|
||||
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 */
|
||||
|
@ -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);
|
||||
|
10
src/misc.c
10
src/misc.c
@ -173,6 +173,16 @@ concat (unsigned int num, ...)
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
#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. */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user