diff options
author | lukem <lukem@pkgsrc.org> | 2004-06-14 02:31:13 +0000 |
---|---|---|
committer | lukem <lukem@pkgsrc.org> | 2004-06-14 02:31:13 +0000 |
commit | 16f02bb61328d69d59dd3a77e2cd29bbeb7942ca (patch) | |
tree | 8bd7547da349a982bef2f61b02eead48a2faca47 | |
parent | dd030e3fb5d3207f42c2cbc92b0b6ebefcccf2f5 (diff) | |
download | pkgsrc-16f02bb61328d69d59dd3a77e2cd29bbeb7942ca.tar.gz |
* Add patches to ensure that signal handlers consistently don't set SA_RESTART
(restartable system calls). (These patches have been submitted back to the
python community.). Fixes the bug in NetBSD PR [pkg/24797] that I submitted.
* Highlight in the DESCR files what the thread support is for that package.
* Bump PKGREVISION.
-rw-r--r-- | lang/python23-pth/DESCR | 2 | ||||
-rw-r--r-- | lang/python23-pth/distinfo | 4 | ||||
-rw-r--r-- | lang/python23-pth/patches/patch-ca | 54 | ||||
-rw-r--r-- | lang/python23-pth/patches/patch-cb | 24 | ||||
-rw-r--r-- | lang/python23/DESCR | 2 | ||||
-rw-r--r-- | lang/python23/Makefile.common | 3 | ||||
-rw-r--r-- | lang/python23/distinfo | 4 | ||||
-rw-r--r-- | lang/python23/patches/patch-ca | 54 | ||||
-rw-r--r-- | lang/python23/patches/patch-cb | 24 |
9 files changed, 168 insertions, 3 deletions
diff --git a/lang/python23-pth/DESCR b/lang/python23-pth/DESCR index 25130675866..3a712368832 100644 --- a/lang/python23-pth/DESCR +++ b/lang/python23-pth/DESCR @@ -12,3 +12,5 @@ written in C or C++. On most systems such modules may be dynamically loaded. Python is also adaptable as an exten- sion language for existing applications. See the internal documentation for hints. + +This package has been compiled with support for threads. diff --git a/lang/python23-pth/distinfo b/lang/python23-pth/distinfo index cd22dc7efe7..138494157d8 100644 --- a/lang/python23-pth/distinfo +++ b/lang/python23-pth/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.17 2004/06/10 10:13:06 recht Exp $ +$NetBSD: distinfo,v 1.18 2004/06/14 02:31:13 lukem Exp $ SHA1 (Python-2.3.4.tgz) = 7d47431febec704e766b57f12a1a5030bb2d03c3 Size (Python-2.3.4.tgz) = 8502738 bytes @@ -12,3 +12,5 @@ SHA1 (patch-al) = 903b42991a83fe5f5f4f3a20f88abb4937174f26 SHA1 (patch-am) = eda4c6161b4237e1281cc6b82b26c5195444dcff SHA1 (patch-ba) = dd8f89952d7f40c9a979e362758775f093e047bc SHA1 (patch-bb) = 7c6fe21b6328dddce2a079b0a1c7ae0bee817bae +SHA1 (patch-ca) = 95f5a515fe3dafd75d077e0591e88a34447152ff +SHA1 (patch-cb) = 301205b29db1ca60f06b2dc0423f5f911eabcd18 diff --git a/lang/python23-pth/patches/patch-ca b/lang/python23-pth/patches/patch-ca new file mode 100644 index 00000000000..337d046d66c --- /dev/null +++ b/lang/python23-pth/patches/patch-ca @@ -0,0 +1,54 @@ +$NetBSD: patch-ca,v 1.1 2004/06/14 02:31:13 lukem Exp $ + +--- Python/pythonrun.c.orig 2004-03-23 07:41:47.000000000 +1100 ++++ Python/pythonrun.c +@@ -1581,13 +1581,13 @@ initsigs(void) + { + #ifdef HAVE_SIGNAL_H + #ifdef SIGPIPE +- signal(SIGPIPE, SIG_IGN); ++ PyOS_setsig(SIGPIPE, SIG_IGN); + #endif + #ifdef SIGXFZ +- signal(SIGXFZ, SIG_IGN); ++ PyOS_setsig(SIGXFZ, SIG_IGN); + #endif + #ifdef SIGXFSZ +- signal(SIGXFSZ, SIG_IGN); ++ PyOS_setsig(SIGXFSZ, SIG_IGN); + #endif + #endif /* HAVE_SIGNAL_H */ + PyOS_InitInterrupts(); /* May imply initsignal() */ +@@ -1684,20 +1684,19 @@ PyOS_sighandler_t + PyOS_setsig(int sig, PyOS_sighandler_t handler) + { + #ifdef HAVE_SIGACTION +- struct sigaction context; +- PyOS_sighandler_t oldhandler; +- /* Initialize context.sa_handler to SIG_ERR which makes about as +- * much sense as anything else. It should get overwritten if +- * sigaction actually succeeds and otherwise we avoid an +- * uninitialized memory read. +- */ +- context.sa_handler = SIG_ERR; +- sigaction(sig, NULL, &context); +- oldhandler = context.sa_handler; ++ struct sigaction context, ocontext; + context.sa_handler = handler; +- sigaction(sig, &context, NULL); +- return oldhandler; ++ sigemptyset(&context.sa_mask); ++ context.sa_flags = 0; ++ if (sigaction(sig, &context, &ocontext) == -1) ++ return SIG_ERR; ++ return ocontext.sa_handler; + #else +- return signal(sig, handler); ++ PyOS_sighandler_t oldhandler; ++ oldhandler = signal(sig, handler); ++#ifdef HAVE_SIGINTERRUPT ++ siginterrupt(sig, 1); ++#endif ++ return oldhandler; + #endif + } diff --git a/lang/python23-pth/patches/patch-cb b/lang/python23-pth/patches/patch-cb new file mode 100644 index 00000000000..53944cda97e --- /dev/null +++ b/lang/python23-pth/patches/patch-cb @@ -0,0 +1,24 @@ +$NetBSD: patch-cb,v 1.1 2004/06/14 02:31:13 lukem Exp $ + +--- Modules/signalmodule.c.orig 2003-03-14 00:56:53.000000000 +1100 ++++ Modules/signalmodule.c +@@ -137,9 +137,6 @@ signal_handler(int sig_num) + return; + } + #endif +-#ifdef HAVE_SIGINTERRUPT +- siginterrupt(sig_num, 1); +-#endif + PyOS_setsig(sig_num, signal_handler); + } + +@@ -217,9 +214,6 @@ signal_signal(PyObject *self, PyObject * + } + else + func = signal_handler; +-#ifdef HAVE_SIGINTERRUPT +- siginterrupt(sig_num, 1); +-#endif + if (PyOS_setsig(sig_num, func) == SIG_ERR) { + PyErr_SetFromErrno(PyExc_RuntimeError); + return NULL; diff --git a/lang/python23/DESCR b/lang/python23/DESCR index 25130675866..183a2d26438 100644 --- a/lang/python23/DESCR +++ b/lang/python23/DESCR @@ -12,3 +12,5 @@ written in C or C++. On most systems such modules may be dynamically loaded. Python is also adaptable as an exten- sion language for existing applications. See the internal documentation for hints. + +This package has been compiled without support for threads. diff --git a/lang/python23/Makefile.common b/lang/python23/Makefile.common index 0bc5d963e35..febe0bfafa2 100644 --- a/lang/python23/Makefile.common +++ b/lang/python23/Makefile.common @@ -1,7 +1,8 @@ -# $NetBSD: Makefile.common,v 1.11 2004/06/02 12:29:28 recht Exp $ +# $NetBSD: Makefile.common,v 1.12 2004/06/14 02:31:13 lukem Exp $ # DISTNAME= Python-2.3.4 +PKGREVISION= 1 CATEGORIES= lang MASTER_SITES= ftp://ftp.python.org/pub/python/2.3.4/ EXTRACT_SUFX= .tgz diff --git a/lang/python23/distinfo b/lang/python23/distinfo index d0647b47ca4..3913f6ce950 100644 --- a/lang/python23/distinfo +++ b/lang/python23/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.18 2004/06/10 10:13:06 recht Exp $ +$NetBSD: distinfo,v 1.19 2004/06/14 02:31:13 lukem Exp $ SHA1 (Python-2.3.4.tgz) = 7d47431febec704e766b57f12a1a5030bb2d03c3 Size (Python-2.3.4.tgz) = 8502738 bytes @@ -11,3 +11,5 @@ SHA1 (patch-ah) = 4bc95e775a2b3f4f1997d0779c561db2e9e7b575 SHA1 (patch-al) = 9708d043b6dff795de5450c88ffb05c65a159942 SHA1 (patch-am) = df5c858b32a9a5aa118c84f6742f9d3547c0c7f3 SHA1 (patch-bb) = 7c6fe21b6328dddce2a079b0a1c7ae0bee817bae +SHA1 (patch-ca) = 95f5a515fe3dafd75d077e0591e88a34447152ff +SHA1 (patch-cb) = 301205b29db1ca60f06b2dc0423f5f911eabcd18 diff --git a/lang/python23/patches/patch-ca b/lang/python23/patches/patch-ca new file mode 100644 index 00000000000..337d046d66c --- /dev/null +++ b/lang/python23/patches/patch-ca @@ -0,0 +1,54 @@ +$NetBSD: patch-ca,v 1.1 2004/06/14 02:31:13 lukem Exp $ + +--- Python/pythonrun.c.orig 2004-03-23 07:41:47.000000000 +1100 ++++ Python/pythonrun.c +@@ -1581,13 +1581,13 @@ initsigs(void) + { + #ifdef HAVE_SIGNAL_H + #ifdef SIGPIPE +- signal(SIGPIPE, SIG_IGN); ++ PyOS_setsig(SIGPIPE, SIG_IGN); + #endif + #ifdef SIGXFZ +- signal(SIGXFZ, SIG_IGN); ++ PyOS_setsig(SIGXFZ, SIG_IGN); + #endif + #ifdef SIGXFSZ +- signal(SIGXFSZ, SIG_IGN); ++ PyOS_setsig(SIGXFSZ, SIG_IGN); + #endif + #endif /* HAVE_SIGNAL_H */ + PyOS_InitInterrupts(); /* May imply initsignal() */ +@@ -1684,20 +1684,19 @@ PyOS_sighandler_t + PyOS_setsig(int sig, PyOS_sighandler_t handler) + { + #ifdef HAVE_SIGACTION +- struct sigaction context; +- PyOS_sighandler_t oldhandler; +- /* Initialize context.sa_handler to SIG_ERR which makes about as +- * much sense as anything else. It should get overwritten if +- * sigaction actually succeeds and otherwise we avoid an +- * uninitialized memory read. +- */ +- context.sa_handler = SIG_ERR; +- sigaction(sig, NULL, &context); +- oldhandler = context.sa_handler; ++ struct sigaction context, ocontext; + context.sa_handler = handler; +- sigaction(sig, &context, NULL); +- return oldhandler; ++ sigemptyset(&context.sa_mask); ++ context.sa_flags = 0; ++ if (sigaction(sig, &context, &ocontext) == -1) ++ return SIG_ERR; ++ return ocontext.sa_handler; + #else +- return signal(sig, handler); ++ PyOS_sighandler_t oldhandler; ++ oldhandler = signal(sig, handler); ++#ifdef HAVE_SIGINTERRUPT ++ siginterrupt(sig, 1); ++#endif ++ return oldhandler; + #endif + } diff --git a/lang/python23/patches/patch-cb b/lang/python23/patches/patch-cb new file mode 100644 index 00000000000..53944cda97e --- /dev/null +++ b/lang/python23/patches/patch-cb @@ -0,0 +1,24 @@ +$NetBSD: patch-cb,v 1.1 2004/06/14 02:31:13 lukem Exp $ + +--- Modules/signalmodule.c.orig 2003-03-14 00:56:53.000000000 +1100 ++++ Modules/signalmodule.c +@@ -137,9 +137,6 @@ signal_handler(int sig_num) + return; + } + #endif +-#ifdef HAVE_SIGINTERRUPT +- siginterrupt(sig_num, 1); +-#endif + PyOS_setsig(sig_num, signal_handler); + } + +@@ -217,9 +214,6 @@ signal_signal(PyObject *self, PyObject * + } + else + func = signal_handler; +-#ifdef HAVE_SIGINTERRUPT +- siginterrupt(sig_num, 1); +-#endif + if (PyOS_setsig(sig_num, func) == SIG_ERR) { + PyErr_SetFromErrno(PyExc_RuntimeError); + return NULL; |