public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Forney <mforney@mforney.org>
To: util-linux@vger.kernel.org
Subject: [PATCH 3/4] Check for type sighandler_t and use if present
Date: Thu,  3 Oct 2013 02:39:18 -0700	[thread overview]
Message-ID: <1380793159-27602-3-git-send-email-mforney@mforney.org> (raw)
In-Reply-To: <1380792968-1176-1-git-send-email-mforney@mforney.org>

__sighandler_t is libc implementation specific and should not be relied
upon. Instead, we fall back upon void (*)(int), as specified by POSIX.
---
 configure.ac    | 4 ++++
 fdisks/cfdisk.c | 6 +++++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 12d0bab..93572fe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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>
 ]])
diff --git a/fdisks/cfdisk.c b/fdisks/cfdisk.c
index 5007fc9..bb32433 100644
--- a/fdisks/cfdisk.c
+++ b/fdisks/cfdisk.c
@@ -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;
-- 
1.8.4


  parent reply	other threads:[~2013-10-03  9:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-03  9:36 Various portability fixes Michael Forney
2013-10-03  9:36 ` [PATCH 1/4] Use _POSIX_VERSION to determine support for %m Michael Forney
2013-10-03  9:39 ` [PATCH 2/4] Add missing includes Michael Forney
2013-10-03  9:39 ` Michael Forney [this message]
2013-10-03  9:39 ` [PATCH 4/4] Fix check for __GNU_LIBRARY__ Michael Forney
2013-10-04 10:30 ` Various portability fixes Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1380793159-27602-3-git-send-email-mforney@mforney.org \
    --to=mforney@mforney.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox