]> granicus.if.org Git - python/commitdiff
Issue #21085: add configure check for siginfo_t.si_band
authorZachary Ware <zachary.ware@gmail.com>
Sat, 1 Oct 2016 05:47:27 +0000 (00:47 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Sat, 1 Oct 2016 05:47:27 +0000 (00:47 -0500)
Patch by Masayuki Yamamoto, reviewed and rebased by Erik Bray.

This is a first step on the long road toward resupporting Cygwin, which does
not provide siginfo_t.si_band.

Misc/ACKS
Misc/NEWS
Modules/signalmodule.c
configure
configure.ac
pyconfig.h.in

index a5465a2af9946ccf8dba8f62883c96ec194acd7c..467f3aae0e4f1df9c6d161de354f16b9c998e93e 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1671,6 +1671,7 @@ Florent Xicluna
 Arnon Yaari
 Alakshendra Yadav
 Hirokazu Yamamoto
+Masayuki Yamamoto
 Ka-Ping Yee
 Chi Hsuan Yen
 Jason Yeo
index 8a0dac9fb5d7c7f7123e908d7f89725e9f2b625b..9d48ff8a0d664d8e5c9d87e8c299bf921c894b88 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -173,6 +173,9 @@ Windows
 Build
 -----
 
+- Issue #21085: Add configure check for siginfo_t.si_band, which Cygwin does
+  not provide.  Patch by Masayuki Yamamoto with review and rebase by Erik Bray.
+
 - Issue #28258: Fixed build with Estonian locale (python-config and distclean
   targets in Makefile).  Patch by Arfrever Frehtes Taifersar Arahesis.
 
index e27075b200194610d07c0fd3aba3ad1f45b36305..bc36d41648e564b536cc285aa0a2f3e4fb1322ec 100644 (file)
@@ -957,7 +957,11 @@ fill_siginfo(siginfo_t *si)
     PyStructSequence_SET_ITEM(result, 4, _PyLong_FromUid(si->si_uid));
     PyStructSequence_SET_ITEM(result, 5,
                                 PyLong_FromLong((long)(si->si_status)));
+#ifdef HAVE_SIGINFO_T_SI_BAND
     PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(si->si_band));
+#else
+    PyStructSequence_SET_ITEM(result, 6, PyLong_FromLong(0L));
+#endif
     if (PyErr_Occurred()) {
         Py_DECREF(result);
         return NULL;
index 860135b2987096582346351e0932af19e4b30ba3..cff86835419e67d778bf96b49227bfa0283d9878 100755 (executable)
--- a/configure
+++ b/configure
@@ -13087,6 +13087,18 @@ cat >>confdefs.h <<_ACEOF
 _ACEOF
 
 
+fi
+
+# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
+ac_fn_c_check_member "$LINENO" "siginfo_t" "si_band" "ac_cv_member_siginfo_t_si_band" "#include <signal.h>
+"
+if test "x$ac_cv_member_siginfo_t_si_band" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_SIGINFO_T_SI_BAND 1
+_ACEOF
+
+
 fi
 
 
index d3956325b8bea219f43853c1dbfbb985ec399f8f..8465afc963a5fa598a303a4e533c8de344c091c0 100644 (file)
@@ -3907,6 +3907,8 @@ AC_CHECK_MEMBERS([struct passwd.pw_gecos, struct passwd.pw_passwd], [], [], [[
   #include <sys/types.h>
   #include <pwd.h>
 ]])
++# Issue #21085: In Cygwin, siginfo_t does not have si_band field.
++AC_CHECK_MEMBERS([siginfo_t.si_band], [], [], [[#include <signal.h>]])
 
 AC_MSG_CHECKING(for time.h that defines altzone)
 AC_CACHE_VAL(ac_cv_header_time_altzone,[
index e7a836c5d42a5dc724bf667ee371f650676d8bb7..bfccabe2f7ad6d4a18630cef88dc782e31d4d174 100644 (file)
 /* Define to 1 if you have the `sigaltstack' function. */
 #undef HAVE_SIGALTSTACK
 
+/* Define to 1 if `si_band' is a member of `siginfo_t'. */
+#undef HAVE_SIGINFO_T_SI_BAND
+
 /* Define to 1 if you have the `siginterrupt' function. */
 #undef HAVE_SIGINTERRUPT