From: Taylor R Campbell Date: Sun, 10 Apr 2011 19:34:53 +0000 (+0000) Subject: Check for tcsetpgrp failure. X-Git-Tag: 20110426-Gtk~2^2~4 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=8e840129eb1636726010c4d701e2c5e7d09c6e40;p=mit-scheme.git Check for tcsetpgrp failure. --- 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;