summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorAnthony Baxter <anthonybaxter@gmail.com>2004-10-13 14:48:50 (GMT)
committerAnthony Baxter <anthonybaxter@gmail.com>2004-10-13 14:48:50 (GMT)
commit9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0 (patch)
tree89e6ac6b3f1ec58c13296765e2301b854a6150d6 /Modules
parent7d428788e156200df2f8e6421cad9fce083fd96b (diff)
downloadcpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.zip
cpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.tar.gz
cpython-9ceaa72ebe96cb5423aa3fb2adede3fcd1c7b6b0.tar.bz2
Patch #975056 - fixes for restartable signals on *BSD. In addition,
a few remaining calls to signal() were converted to PyOS_setsig().
Diffstat (limited to 'Modules')
-rw-r--r--Modules/posixmodule.c8
-rw-r--r--Modules/signalmodule.c6
-rw-r--r--Modules/socketmodule.c2
3 files changed, 5 insertions, 11 deletions
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 764fa4c..e71467b 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -2903,18 +2903,18 @@ posix_openpty(PyObject *self, PyObject *noargs)
master_fd = open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */
if (master_fd < 0)
return posix_error();
- sig_saved = signal(SIGCHLD, SIG_DFL);
+ sig_saved = PyOS_setsig(SIGCHLD, SIG_DFL);
/* change permission of slave */
if (grantpt(master_fd) < 0) {
- signal(SIGCHLD, sig_saved);
+ PyOS_setsig(SIGCHLD, sig_saved);
return posix_error();
}
/* unlock slave */
if (unlockpt(master_fd) < 0) {
- signal(SIGCHLD, sig_saved);
+ PyOS_setsig(SIGCHLD, sig_saved);
return posix_error();
}
- signal(SIGCHLD, sig_saved);
+ PyOS_setsig(SIGCHLD, sig_saved);
slave_name = ptsname(master_fd); /* get name of slave */
if (slave_name == NULL)
return posix_error();
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index 333fe77..f952e3e 100644
--- a/Modules/signalmodule.c
+++ b/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 *args)
}
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/Modules/socketmodule.c b/Modules/socketmodule.c
index 521a51f..7b8b4af 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -217,7 +217,7 @@ shutdown(how) -- shut down traffic in one or both directions\n\
/* Generic includes */
#include <sys/types.h>
-#include <signal.h>
+//#include <signal.h>
/* Generic socket object definitions and includes */
#define PySocket_BUILDING_SOCKET