From 15efec6ad51f5292a5f4d7b314219125d69e9acb Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Tue, 24 Mar 2015 14:21:22 +0000 Subject: 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. --- shell/shell_common.c | 2 ++ 1 file changed, 2 insertions(+) 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), * regardless of SA_RESTART-ness of that signal! */ errno = 0; +#if !ENABLE_PLATFORM_MINGW32 pfd[0].fd = fd; pfd[0].events = POLLIN; if (poll(pfd, 1, timeout) != 1) { @@ -198,6 +199,7 @@ shell_builtin_read(void FAST_FUNC (*setvar)(const char *name, const char *val), retval = (const char *)(uintptr_t)1; goto ret; } +#endif if (read(fd, &buffer[bufpos], 1) != 1) { err = errno; retval = (const char *)(uintptr_t)1; -- cgit v1.2.3-55-g6feb