aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2023-03-05 11:03:20 +0000
committerRon Yorston <rmy@pobox.com>2023-03-05 11:03:20 +0000
commit76d3eafb4c28bc6579baff917ffe7726acf6817a (patch)
tree9dd60b1c2c0938964ac536a7325d9ca0a5f11fe6
parent1036069556897964766dfdf22cda1dd11d891cdf (diff)
downloadbusybox-w32-76d3eafb4c28bc6579baff917ffe7726acf6817a.tar.gz
busybox-w32-76d3eafb4c28bc6579baff917ffe7726acf6817a.tar.bz2
busybox-w32-76d3eafb4c28bc6579baff917ffe7726acf6817a.zip
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.
-rw-r--r--shell/shell_common.c12
1 files changed, 0 insertions, 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)
129 * bash seems to ignore -p PROMPT for this use case. 129 * bash seems to ignore -p PROMPT for this use case.
130 */ 130 */
131 int r; 131 int r;
132#if ENABLE_PLATFORM_MINGW32
133 HANDLE handle = (HANDLE)_get_osfhandle(fd);
134 DWORD filetype = FILE_TYPE_UNKNOWN;
135
136 if (handle != INVALID_HANDLE_VALUE)
137 filetype = GetFileType(handle);
138 /* poll uses WaitForSingleObject which can't handle disk files */
139 if (filetype == FILE_TYPE_DISK || filetype == FILE_TYPE_UNKNOWN)
140 return (const char *)(uintptr_t)(0);
141 if (isatty(fd))
142 return (const char *)(uintptr_t)(1);
143#endif
144 pfd[0].events = POLLIN; 132 pfd[0].events = POLLIN;
145 r = poll(pfd, 1, /*timeout:*/ 0); 133 r = poll(pfd, 1, /*timeout:*/ 0);
146 /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */ 134 /* Return 0 only if poll returns 1 ("one fd ready"), else return 1: */