bug-m4
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sa_sigaction [was: snapshot in preparation for m4 1.4.12]


From: Eric Blake
Subject: Re: sa_sigaction [was: snapshot in preparation for m4 1.4.12]
Date: Sun, 17 Aug 2008 08:17:50 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Eric Blake on 8/15/2008 10:15 PM:
> At any rate, I'm still working on a patch that makes lib/signal.in.h add
> the #define for sa_sigaction if HAVE_SIGACTION &&
> !HAVE_STRUCT_SIGACTION_SA_SIGACTION.  I'll post a snapshot for you to try
> once I get it completed.

Committing this:

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkioMw4ACgkQ84KuGfSFAYAF/QCdGEdVkRsVLsQV2mmM9oZPTiNV
WtEAn2X3obPOLqrVsIxgCim6qptvadsI
=F03o
-----END PGP SIGNATURE-----
>From a3f953e86848ed858ed655bba12a7fbbab57f1c5 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Sat, 16 Aug 2008 13:47:58 -0600
Subject: [PATCH] c-stack: fix regression on Irix 5.3 from 2008-06-21

* m4/c-stack.m4 (gl_PREREQ_C_STACK): Move check for
sa_sigaction...
* m4/sigaction.m4 (gl_PREREQ_SIG_HANDLER_H): ...here.
(gl_PREREQ_SIGACTION): Depend on sig-handler.h prereq's.
* m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Set the default.
* modules/signal (Makefile.am): Use the value.
* lib/signal.in.h (sa_sigaction) [HAVE_SIGACTION
&& !HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define.
* doc/posix-headers/signal.texi (signal.h): Document this
portability issue.
* doc/posix-functions/sigaction.texi (sigaction): Likewise.
Reported by Tom G. Christensen.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog                          |   16 ++++++++++++++++
 doc/posix-functions/sigaction.texi |    5 +++++
 doc/posix-headers/signal.texi      |    9 +++++----
 lib/signal.in.h                    |    6 +++++-
 m4/c-stack.m4                      |    4 +---
 m4/sigaction.m4                    |   10 ++++++++--
 m4/signal_h.m4                     |    4 +++-
 modules/signal                     |    1 +
 8 files changed, 44 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 2ec2e87..062b03e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-08-16  Eric Blake  <address@hidden>
+
+       c-stack: fix regression on Irix 5.3 from 2008-06-21
+       * m4/c-stack.m4 (gl_PREREQ_C_STACK): Move check for
+       sa_sigaction...
+       * m4/sigaction.m4 (gl_PREREQ_SIG_HANDLER_H): ...here.
+       (gl_PREREQ_SIGACTION): Depend on sig-handler.h prereq's.
+       * m4/signal_h.m4 (gl_SIGNAL_H_DEFAULTS): Set the default.
+       * modules/signal (Makefile.am): Use the value.
+       * lib/signal.in.h (sa_sigaction) [HAVE_SIGACTION
+       && !HAVE_STRUCT_SIGACTION_SA_SIGACTION]: Define.
+       * doc/posix-headers/signal.texi (signal.h): Document this
+       portability issue.
+       * doc/posix-functions/sigaction.texi (sigaction): Likewise.
+       Reported by Tom G. Christensen.
+
 2008-08-17  Bruno Haible  <address@hidden>
 
        New module 'threadlib'.
diff --git a/doc/posix-functions/sigaction.texi 
b/doc/posix-functions/sigaction.texi
index 56795d9..c48519a 100644
--- a/doc/posix-functions/sigaction.texi
+++ b/doc/posix-functions/sigaction.texi
@@ -37,6 +37,11 @@ Support for SA_RESTART is missing on some platforms:
 mingw.
 
 @item
+In spite of having SA_SIGACTION, struct sigaction lacks the
+sa_sigaction member on some platforms:
+Irix 5.3.
+
address@hidden
 The symbolic value @code{SIG_IGN} for the @code{SIGCHLD} signal is equivalent
 to a signal handler
 @smallexample
diff --git a/doc/posix-headers/signal.texi b/doc/posix-headers/signal.texi
index cb4f580..9244089 100644
--- a/doc/posix-headers/signal.texi
+++ b/doc/posix-headers/signal.texi
@@ -15,12 +15,13 @@ mingw.
 @code{struct sigaction} and @code{siginfo_t} are missing on some
 platforms:
 mingw.
+
address@hidden
address@hidden sigaction} lacks the @code{sa_sigaction} member on some
+platforms:
+Irix 5.3, Interix 3.5.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
address@hidden
address@hidden sigaction} lacks the @code{sa_sigaction} member on some
-platforms; this can also be detected by whether @code{SA_SIGINFO} is defined:
-Interix 3.5.
 @end itemize
diff --git a/lib/signal.in.h b/lib/signal.in.h
index 703437d..7df5d5f 100644
--- a/lib/signal.in.h
+++ b/lib/signal.in.h
@@ -146,7 +146,11 @@ struct sigaction
 extern int sigaction (int, const struct sigaction *restrict,
                       struct sigaction *restrict);
 
-#endif /* address@hidden@ */
+#elif address@hidden@
+
+# define sa_sigaction sa_handler
+
+#endif /* address@hidden@, address@hidden@ */
 
 
 #ifdef __cplusplus
diff --git a/m4/c-stack.m4 b/m4/c-stack.m4
index b1f93ed..1db2a50 100644
--- a/m4/c-stack.m4
+++ b/m4/c-stack.m4
@@ -7,7 +7,7 @@
 
 # Written by Paul Eggert.
 
-# serial 3
+# serial 4
 
 AC_DEFUN([AC_SYS_XSI_STACK_OVERFLOW_HEURISTIC],
   [# for STACK_DIRECTION
@@ -146,8 +146,6 @@ AC_DEFUN([gl_PREREQ_C_STACK],
 
    AC_CHECK_HEADERS_ONCE([unistd.h ucontext.h])
 
-   AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , , [#include <signal.h>])
-
    AC_CHECK_TYPES([stack_t], , , [#include <signal.h>])
 
    dnl c-stack does not need -lsigsegv if the system has XSI heuristics.
diff --git a/m4/sigaction.m4 b/m4/sigaction.m4
index 790116a..f11d4cf 100644
--- a/m4/sigaction.m4
+++ b/m4/sigaction.m4
@@ -1,4 +1,4 @@
-# sigaction.m4 serial 3
+# sigaction.m4 serial 4
 dnl Copyright (C) 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -22,6 +22,7 @@ AC_DEFUN([gl_PREREQ_SIGACTION],
   AC_REQUIRE([gl_SIGNAL_H_DEFAULTS])
   AC_REQUIRE([AC_C_RESTRICT])
   AC_REQUIRE([AC_TYPE_UID_T])
+  AC_REQUIRE([gl_PREREQ_SIG_HANDLER_H])
   AC_CHECK_FUNCS_ONCE([sigaltstack siginterrupt])
   AC_CHECK_TYPES([siginfo_t], [], [], [[
 #include <signal.h>
@@ -36,5 +37,10 @@ AC_DEFUN([gl_PREREQ_SIGACTION],
 AC_DEFUN([gl_PREREQ_SIG_HANDLER_H],
 [
   AC_REQUIRE([AC_C_INLINE])
-  :
+  AC_CHECK_MEMBERS([struct sigaction.sa_sigaction], , ,
+                   [[#include <signal.h>]])
+  if test $ac_cv_member_struct_sigaction_sa_sigaction = no; then
+    HAVE_STRUCT_SIGACTION_SA_SIGACTION=0
+    AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
+  fi
 ])
diff --git a/m4/signal_h.m4 b/m4/signal_h.m4
index bf2bad4..0a10547 100644
--- a/m4/signal_h.m4
+++ b/m4/signal_h.m4
@@ -1,4 +1,4 @@
-# signal_h.m4 serial 4
+# signal_h.m4 serial 5
 dnl Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -26,4 +26,6 @@ AC_DEFUN([gl_SIGNAL_H_DEFAULTS],
   HAVE_SIGSET_T=1;             AC_SUBST([HAVE_SIGSET_T])
   HAVE_SIGINFO_T=1;            AC_SUBST([HAVE_SIGINFO_T])
   HAVE_SIGACTION=1;            AC_SUBST([HAVE_SIGACTION])
+  HAVE_STRUCT_SIGACTION_SA_SIGACTION=1;
+                               AC_SUBST([HAVE_STRUCT_SIGACTION_SA_SIGACTION])
 ])
diff --git a/modules/signal b/modules/signal
index afe6ab3..c4fccc5 100644
--- a/modules/signal
+++ b/modules/signal
@@ -28,6 +28,7 @@ signal.h: signal.in.h
              -e 's|@''HAVE_SIGSET_T''@|$(HAVE_SIGSET_T)|g' \
              -e 's|@''HAVE_SIGINFO_T''@|$(HAVE_SIGINFO_T)|g' \
              -e 's|@''HAVE_SIGACTION''@|$(HAVE_SIGACTION)|g' \
+             -e 
's|@''HAVE_STRUCT_SIGACTION_SA_SIGACTION''@|$(HAVE_STRUCT_SIGACTION_SA_SIGACTION)|g'
 \
              -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \
              < $(srcdir)/signal.in.h; \
        } > address@hidden
-- 
1.5.6.4


reply via email to

[Prev in Thread] Current Thread [Next in Thread]