e45eeb9d70
support (what used to be the python23 package). Python is an interpreted, interactive, object-oriented programming language that combines remarkable power with very clear syntax. For an introduction to programming in Python you are referred to the Python Tutorial. The Python Library Reference documents built-in and standard types, constants, functions and modules. Finally, the Python Reference Manual describes the syntax and semantics of the core language in (perhaps too) much detail. Python's basic power can be extended with your own modules 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.
54 lines
1.5 KiB
Text
54 lines
1.5 KiB
Text
$NetBSD: patch-ca,v 1.1.1.1 2005/01/23 22:57:21 recht 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
|
|
}
|