summaryrefslogtreecommitdiff
path: root/m4/pthread_sigmask.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/pthread_sigmask.m4')
-rw-r--r--m4/pthread_sigmask.m47
1 files changed, 5 insertions, 2 deletions
diff --git a/m4/pthread_sigmask.m4 b/m4/pthread_sigmask.m4
index 0aa8c53f9ec..8282a371e4c 100644
--- a/m4/pthread_sigmask.m4
+++ b/m4/pthread_sigmask.m4
@@ -215,6 +215,7 @@ int main ()
LIBS="$LIBS $LIBMULTITHREAD"])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
+#include <limits.h>
#include <pthread.h>
#include <signal.h>
#include <stdio.h>
@@ -230,14 +231,16 @@ sigint_handler (int sig)
int main ()
{
sigset_t set;
- int pid = getpid ();
+ pid_t pid = getpid ();
char command[80];
+ if (LONG_MAX < pid)
+ return 6;
signal (SIGINT, sigint_handler);
sigemptyset (&set);
sigaddset (&set, SIGINT);
if (!(pthread_sigmask (SIG_BLOCK, &set, NULL) == 0))
return 1;
- sprintf (command, "sh -c 'sleep 1; kill -%d %d' &", SIGINT, pid);
+ sprintf (command, "sh -c 'sleep 1; kill -INT %ld' &", (long) pid);
if (!(system (command) == 0))
return 2;
sleep (2);