From e572255fd2cac3b0c3bbade9551b201b28c39ca6 Mon Sep 17 00:00:00 2001 From: Martin Lund Date: Thu, 11 Jan 2024 20:36:17 +0100 Subject: [PATCH] Fix file descriptor handling on MacOS --- src/tty.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tty.c b/src/tty.c index cdab4b9..49024cd 100644 --- a/src/tty.c +++ b/src/tty.c @@ -1582,9 +1582,15 @@ int tty_connect(void) { goto error_read; } -#endif +#elif defined(__APPLE__) + if (errno == EBADF) + { + goto error_read; + } +#else tio_error_printf("select() failed (%s)", strerror(errno)); exit(EXIT_FAILURE); +#endif } else {