Issue #23836: Use _Py_write_noraise() to retry on EINTR in trip_signal() of

signalmodule.c
This commit is contained in:
Victor Stinner 2015-04-01 18:35:22 +02:00
parent 6f4fae8a95
commit e72fe3995b
1 changed files with 4 additions and 3 deletions

View File

@ -263,9 +263,10 @@ trip_signal(int sig_num)
#endif #endif
{ {
byte = (unsigned char)sig_num; byte = (unsigned char)sig_num;
do {
rc = write(fd, &byte, 1); /* _Py_write_noraise() retries write() if write() is interrupted by
} while (rc < 0 && errno == EINTR); a signal (fails with EINTR). */
rc = _Py_write_noraise(fd, &byte, 1);
if (rc < 0) { if (rc < 0) {
Py_AddPendingCall(report_wakeup_write_error, Py_AddPendingCall(report_wakeup_write_error,