]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
build-sys: Check for type sighandler_t and use if present
authorMichael Forney <mforney@mforney.org>
Thu, 3 Oct 2013 09:39:18 +0000 (02:39 -0700)
committerKarel Zak <kzak@redhat.com>
Fri, 4 Oct 2013 09:51:34 +0000 (11:51 +0200)
__sighandler_t is libc implementation specific and should not be relied
upon. Instead, we fall back upon void (*)(int), as specified by POSIX.

Signed-off-by: Karel Zak <kzak@redhat.com>
configure.ac
fdisks/cfdisk.c

index 12d0babf7fd87c36bde8cecb28c89469cca7d8ee..93572fe8a2fb781c658ce4cc21abdfa6be44d96e 100644 (file)
@@ -497,6 +497,10 @@ AC_CHECK_TYPES([cpu_set_t], [have_cpu_set_t=yes], [], [[
 
 AM_CONDITIONAL([HAVE_CPU_SET_T], [test "x$have_cpu_set_t" = xyes])
 
+AC_CHECK_TYPES([sighandler_t], [], [], [[
+#include <signal.h>
+]])
+
 AC_CHECK_DECLS([CPU_ALLOC], [], [], [[
 #include <sched.h>
 ]])
index 5007fc99e3f600e3ca01bae233ec77c304aa2c32..bb324338a8dadca34bd43ca03a1d0a5cba64d08d 100644 (file)
@@ -324,7 +324,11 @@ int num_parts = 0;
 int logical = 0;
 long long logical_sectors[MAXIMUM_PARTS];
 
-__sighandler_t old_SIGINT, old_SIGTERM;
+#ifdef HAVE_SIGHANDLER_T
+sighandler_t old_SIGINT, old_SIGTERM;
+#else
+void (* old_SIGINT)(int), (* old_SIGTERM)(int);
+#endif
 
 int arrow_cursor = FALSE;
 int display_units = MEGABYTES;