From b893128a40446cefdb6e41c21c7c42334b9f8261 Mon Sep 17 00:00:00 2001 From: Taylor R Campbell Date: Tue, 14 Jun 2011 03:28:23 +0000 Subject: [PATCH] Fix calls to tcsetpgrp to avoid infinite loops on ENOSYS. --- src/microcode/uxproc.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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. */ -- 2.25.1