From 8e840129eb1636726010c4d701e2c5e7d09c6e40 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Sun, 10 Apr 2011 19:34:53 +0000 Subject: [PATCH] Check for tcsetpgrp failure. --- src/microcode/uxproc.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/microcode/uxproc.c b/src/microcode/uxproc.c index a624fcd21..9412805e2 100644 --- a/src/microcode/uxproc.c +++ b/src/microcode/uxproc.c @@ -653,7 +653,9 @@ give_terminal_to (Tprocess process) foreground_child_process = process; OS_save_internal_state (); OS_restore_external_state (); - UX_tcsetpgrp (scheme_ctty_fd, (PROCESS_ID (process))); + while ((UX_tcsetpgrp (scheme_ctty_fd, (PROCESS_ID (process)))) < 0) + if ((errno != ENOSYS) && (errno != EINTR)) + error_system_call (errno, syscall_tcsetpgrp); } } @@ -662,7 +664,12 @@ get_terminal_back (void) { if (foreground_child_process != NO_PROCESS) { - UX_tcsetpgrp (scheme_ctty_fd, (UX_getpgrp ())); + while ((UX_tcsetpgrp (scheme_ctty_fd, (UX_getpgrp ()))) < 0) + if ((errno != ENOSYS) && (errno != EINTR)) + /* We're in no position to signal an error here (inside a + transaction commit/abort action or a signal handler), so + just bail. */ + break; OS_save_external_state (); OS_restore_internal_state (); foreground_child_process = NO_PROCESS; -- 2.25.1