summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Stinner <victor.stinner@gmail.com>2015-04-01 16:35:22 (GMT)
committerVictor Stinner <victor.stinner@gmail.com>2015-04-01 16:35:22 (GMT)
commite72fe3995b231eb9cb350180603ee11a5293d737 (patch)
treeebd2912d3a809c341f6650ccbb94cb49bcfd6fe0
parent6f4fae8a951d95acf7a9151ed13a45dc3e395b9f (diff)
downloadcpython-e72fe3995b231eb9cb350180603ee11a5293d737.zip
cpython-e72fe3995b231eb9cb350180603ee11a5293d737.tar.gz
cpython-e72fe3995b231eb9cb350180603ee11a5293d737.tar.bz2
Issue #23836: Use _Py_write_noraise() to retry on EINTR in trip_signal() of
signalmodule.c
-rw-r--r--Modules/signalmodule.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/Modules/signalmodule.c b/Modules/signalmodule.c
index a1fda3e..cc13194 100644
--- a/Modules/signalmodule.c
+++ b/Modules/signalmodule.c
@@ -263,9 +263,10 @@ trip_signal(int sig_num)
#endif
{
byte = (unsigned char)sig_num;
- do {
- rc = write(fd, &byte, 1);
- } while (rc < 0 && errno == EINTR);
+
+ /* _Py_write_noraise() retries write() if write() is interrupted by
+ a signal (fails with EINTR). */
+ rc = _Py_write_noraise(fd, &byte, 1);
if (rc < 0) {
Py_AddPendingCall(report_wakeup_write_error,