[Python-checkins] python/dist/src/Parser intrcheck.c,2.45,2.46

anthonybaxter at users.sourceforge.net anthonybaxter at users.sourceforge.net
Wed Oct 13 16:48:53 CEST 2004


Update of /cvsroot/python/python/dist/src/Parser
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27121/Parser

Modified Files:
	intrcheck.c 
Log Message:
Patch #975056 - fixes for restartable signals on *BSD. In addition, 
a few remaining calls to signal() were converted to PyOS_setsig().


Index: intrcheck.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Parser/intrcheck.c,v
retrieving revision 2.45
retrieving revision 2.46
diff -u -d -r2.45 -r2.46
--- intrcheck.c	20 Nov 2003 01:44:58 -0000	2.45
+++ intrcheck.c	13 Oct 2004 14:48:50 -0000	2.46
@@ -137,7 +137,7 @@
 		Py_Exit(1);
 		break;
 	}
-	signal(SIGINT, intcatcher);
+	PyOS_setsig(SIGINT, intcatcher);
 	Py_AddPendingCall(checksignals_witharg, NULL);
 }
 
@@ -146,23 +146,14 @@
 void
 PyOS_InitInterrupts(void)
 {
-	if ((old_siginthandler = signal(SIGINT, SIG_IGN)) != SIG_IGN)
-		signal(SIGINT, intcatcher);
-#ifdef HAVE_SIGINTERRUPT
-	/* This is for SunOS and other modern BSD derivatives.
-	   It means that system calls (like read()) are not restarted
-	   after an interrupt.  This is necessary so interrupting a
-	   read() or readline() call works as expected.
-	   XXX On old BSD (pure 4.2 or older) you may have to do this
-	   differently! */
-	siginterrupt(SIGINT, 1);
-#endif /* HAVE_SIGINTERRUPT */
+	if ((old_siginthandler = PyOS_setsig(SIGINT, SIG_IGN)) != SIG_IGN)
+		PyOS_setsig(SIGINT, intcatcher);
 }
 
 void
 PyOS_FiniInterrupts(void)
 {
-	signal(SIGINT, old_siginthandler);
+	PyOS_setsig(SIGINT, old_siginthandler);
 }
 
 int



More information about the Python-checkins mailing list