From 76d3eafb4c28bc6579baff917ffe7726acf6817a Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sun, 5 Mar 2023 11:03:20 +0000 Subject: ash: drop workaround for 'read -t 0' Commit 0eda390d6 (ash: improve handling of 'read -t 0') added code to work around the limitations of our poll(2) implementation. Now that poll(2) has been improved the workaround is unnecessary. Saves 64 bytes. --- shell/shell_common.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/shell/shell_common.c b/shell/shell_common.c index eb2c4fbf5..9d74dcb7a 100644 --- a/shell/shell_common.c +++ b/shell/shell_common.c @@ -129,18 +129,6 @@ shell_builtin_read(struct builtin_read_params *params) * bash seems to ignore -p PROMPT for this use case. */ int r; -#if ENABLE_PLATFORM_MINGW32 - HANDLE handle = (HANDLE)_get_osfhandle(fd); - DWORD filetype = FILE_TYPE_UNKNOWN; - - if (handle != INVALID_HANDLE_VALUE) - filetype = GetFileType(handle); - /* poll uses WaitForSingleObject which can't handle disk files */ - if (filetype == FILE_TYPE_DISK || filetype == FILE_TYPE_UNKNOWN) - return (const char *)(uintptr_t)(0); - if (isatty(fd)) - return (const char *)(uintptr_t)(1); -#endif pfd[0].events = POLLIN; r = poll(pfd, 1, /*timeout:*/ 0); /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */ -- cgit v1.2.3-55-g6feb