pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/lang * Add patches to ensure that signal handlers cons...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/c9c1af08f07e
branches:  trunk
changeset: 476557:c9c1af08f07e
user:      lukem <lukem%pkgsrc.org@localhost>
date:      Mon Jun 14 02:31:13 2004 +0000

description:
* 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.

diffstat:

 lang/python23-pth/DESCR            |   2 +
 lang/python23-pth/distinfo         |   4 ++-
 lang/python23-pth/patches/patch-ca |  54 ++++++++++++++++++++++++++++++++++++++
 lang/python23-pth/patches/patch-cb |  24 ++++++++++++++++
 lang/python23/DESCR                |   2 +
 lang/python23/Makefile.common      |   3 +-
 lang/python23/distinfo             |   4 ++-
 lang/python23/patches/patch-ca     |  54 ++++++++++++++++++++++++++++++++++++++
 lang/python23/patches/patch-cb     |  24 ++++++++++++++++
 9 files changed, 168 insertions(+), 3 deletions(-)

diffs (233 lines):

diff -r b6e767faf69b -r c9c1af08f07e lang/python23-pth/DESCR
--- a/lang/python23-pth/DESCR   Mon Jun 14 01:18:16 2004 +0000
+++ b/lang/python23-pth/DESCR   Mon Jun 14 02:31:13 2004 +0000
@@ -12,3 +12,5 @@
 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 -r b6e767faf69b -r c9c1af08f07e lang/python23-pth/distinfo
--- a/lang/python23-pth/distinfo        Mon Jun 14 01:18:16 2004 +0000
+++ b/lang/python23-pth/distinfo        Mon Jun 14 02:31:13 2004 +0000
@@ -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-am) = eda4c6161b4237e1281cc6b82b26c5195444dcff
 SHA1 (patch-ba) = dd8f89952d7f40c9a979e362758775f093e047bc
 SHA1 (patch-bb) = 7c6fe21b6328dddce2a079b0a1c7ae0bee817bae
+SHA1 (patch-ca) = 95f5a515fe3dafd75d077e0591e88a34447152ff
+SHA1 (patch-cb) = 301205b29db1ca60f06b2dc0423f5f911eabcd18
diff -r b6e767faf69b -r c9c1af08f07e lang/python23-pth/patches/patch-ca
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python23-pth/patches/patch-ca        Mon Jun 14 02:31:13 2004 +0000
@@ -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 -r b6e767faf69b -r c9c1af08f07e lang/python23-pth/patches/patch-cb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python23-pth/patches/patch-cb        Mon Jun 14 02:31:13 2004 +0000
@@ -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 -r b6e767faf69b -r c9c1af08f07e lang/python23/DESCR
--- a/lang/python23/DESCR       Mon Jun 14 01:18:16 2004 +0000
+++ b/lang/python23/DESCR       Mon Jun 14 02:31:13 2004 +0000
@@ -12,3 +12,5 @@
 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 -r b6e767faf69b -r c9c1af08f07e lang/python23/Makefile.common
--- a/lang/python23/Makefile.common     Mon Jun 14 01:18:16 2004 +0000
+++ b/lang/python23/Makefile.common     Mon Jun 14 02:31:13 2004 +0000
@@ -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 -r b6e767faf69b -r c9c1af08f07e lang/python23/distinfo
--- a/lang/python23/distinfo    Mon Jun 14 01:18:16 2004 +0000
+++ b/lang/python23/distinfo    Mon Jun 14 02:31:13 2004 +0000
@@ -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-al) = 9708d043b6dff795de5450c88ffb05c65a159942
 SHA1 (patch-am) = df5c858b32a9a5aa118c84f6742f9d3547c0c7f3
 SHA1 (patch-bb) = 7c6fe21b6328dddce2a079b0a1c7ae0bee817bae
+SHA1 (patch-ca) = 95f5a515fe3dafd75d077e0591e88a34447152ff
+SHA1 (patch-cb) = 301205b29db1ca60f06b2dc0423f5f911eabcd18
diff -r b6e767faf69b -r c9c1af08f07e lang/python23/patches/patch-ca
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python23/patches/patch-ca    Mon Jun 14 02:31:13 2004 +0000
@@ -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 -r b6e767faf69b -r c9c1af08f07e lang/python23/patches/patch-cb
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/python23/patches/patch-cb    Mon Jun 14 02:31:13 2004 +0000
@@ -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;



Home | Main Index | Thread Index | Old Index