From: Taylor R Campbell Date: Tue, 14 Jun 2011 03:28:23 +0000 (+0000) Subject: Fix calls to tcsetpgrp to avoid infinite loops on ENOSYS. X-Git-Tag: release-9.1.0~23 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b893128a40446cefdb6e41c21c7c42334b9f8261;p=mit-scheme.git Fix calls to tcsetpgrp to avoid infinite loops on ENOSYS. --- diff --git a/src/microcode/uxproc.c b/src/microcode/uxproc.c index c52441c41..b09fae575 100644 --- a/src/microcode/uxproc.c +++ b/src/microcode/uxproc.c @@ -654,8 +654,12 @@ give_terminal_to (Tprocess process) OS_save_internal_state (); OS_restore_external_state (); while ((UX_tcsetpgrp (scheme_ctty_fd, (PROCESS_ID (process)))) < 0) - if ((errno != ENOSYS) && (errno != EINTR)) - error_system_call (errno, syscall_tcsetpgrp); + { + if (errno == ENOSYS) + break; + if (errno != EINTR) + error_system_call (errno, syscall_tcsetpgrp); + } } } @@ -665,7 +669,7 @@ get_terminal_back (void) if (foreground_child_process != NO_PROCESS) { while ((UX_tcsetpgrp (scheme_ctty_fd, (UX_getpgrp ()))) < 0) - if ((errno != ENOSYS) && (errno != EINTR)) + if (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. */