aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRon Yorston <rmy@pobox.com>2015-03-24 14:21:22 +0000
committerRon Yorston <rmy@pobox.com>2015-03-24 14:21:22 +0000
commit15efec6ad51f5292a5f4d7b314219125d69e9acb (patch)
treea7e6978a3275a22b21bbbd1bb3125ac172629696
parent538a16d15016b9be9885e94e9b94a4cbfb760501 (diff)
downloadbusybox-w32-15efec6ad51f5292a5f4d7b314219125d69e9acb.tar.gz
busybox-w32-15efec6ad51f5292a5f4d7b314219125d69e9acb.tar.bz2
busybox-w32-15efec6ad51f5292a5f4d7b314219125d69e9acb.zip
ash: skip poll in read built-in
GNUlib poll doesn't seem to work when the file descriptor refers to a file on disk. This may not be surprising given the warning in the Windows API documentation against using disk file handles in calls to WaitForSingleObject. Skipping poll in the read built-in allows file redirection to work and doesn't make interrupt handling any worse than it was before.
-rw-r--r--shell/shell_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 4c870fab8..2244a3c97 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -190,6 +190,7 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),
190 * regardless of SA_RESTART-ness of that signal! 190 * regardless of SA_RESTART-ness of that signal!
191 */ 191 */
192 errno = 0; 192 errno = 0;
193#if !ENABLE_PLATFORM_MINGW32
193 pfd[0].fd = fd; 194 pfd[0].fd = fd;
194 pfd[0].events = POLLIN; 195 pfd[0].events = POLLIN;
195 if (poll(pfd, 1, timeout) != 1) { 196 if (poll(pfd, 1, timeout) != 1) {
@@ -198,6 +199,7 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val),
198 retval = (const char *)(uintptr_t)1; 199 retval = (const char *)(uintptr_t)1;
199 goto ret; 200 goto ret;
200 } 201 }
202#endif
201 if (read(fd, &buffer[bufpos], 1) != 1) { 203 if (read(fd, &buffer[bufpos], 1) != 1) {
202 err = errno; 204 err = errno;
203 retval = (const char *)(uintptr_t)1; 205 retval = (const char *)(uintptr_t)1;