another errno in a signal handler

This commit is contained in:
Matthew Flatt 2016-10-13 11:25:27 -06:00
parent 6e2978fe5c
commit a9f2765b4f

View File

@ -10917,12 +10917,14 @@ void scheme_signal_received_at(void *h)
{ {
#if defined(FILES_HAVE_FDS) #if defined(FILES_HAVE_FDS)
int put_ext_event_fd = *(int *)h; int put_ext_event_fd = *(int *)h;
int saved_errno = errno;
if (put_ext_event_fd) { if (put_ext_event_fd) {
int v; int v;
do { do {
v = write(put_ext_event_fd, "!", 1); v = write(put_ext_event_fd, "!", 1);
} while ((v == -1) && (errno == EINTR)); } while ((v == -1) && (errno == EINTR));
} }
errno = saved_errno;
#endif #endif
#if defined(WINDOWS_PROCESSES) || defined(WINDOWS_FILE_HANDLES) #if defined(WINDOWS_PROCESSES) || defined(WINDOWS_FILE_HANDLES)
ReleaseSemaphore(*(OS_SEMAPHORE_TYPE *)h, 1, NULL); ReleaseSemaphore(*(OS_SEMAPHORE_TYPE *)h, 1, NULL);