aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shell/shell_common.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 99e56a050..657ee9969 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -195,7 +195,6 @@ shell_builtin_read(struct builtin_read_params *params)
195 } 195 }
196 } 196 }
197 197
198#if !ENABLE_PLATFORM_MINGW32
199 /* We must poll even if timeout is -1: 198 /* We must poll even if timeout is -1:
200 * we want to be interrupted if signal arrives, 199 * we want to be interrupted if signal arrives,
201 * regardless of SA_RESTART-ness of that signal! 200 * regardless of SA_RESTART-ness of that signal!
@@ -209,13 +208,7 @@ shell_builtin_read(struct builtin_read_params *params)
209 retval = (const char *)(uintptr_t)1; 208 retval = (const char *)(uintptr_t)1;
210 goto ret; 209 goto ret;
211 } 210 }
212 if (read(fd, &buffer[bufpos], 1) != 1) { 211#if ENABLE_PLATFORM_MINGW32
213 err = errno;
214 retval = (const char *)(uintptr_t)1;
215 break;
216 }
217#else
218 errno = 0;
219 if (isatty(fd)) { 212 if (isatty(fd)) {
220 int64_t key; 213 int64_t key;
221 214
@@ -245,15 +238,13 @@ shell_builtin_read(struct builtin_read_params *params)
245 /* echo input if not in silent mode */ 238 /* echo input if not in silent mode */
246 console_write(buffer + bufpos, 1); 239 console_write(buffer + bufpos, 1);
247 } 240 }
248 } 241 } else
249 else {
250 if (read(fd, &buffer[bufpos], 1) != 1) {
251 err = errno;
252 retval = (const char *)(uintptr_t)1;
253 break;
254 }
255 }
256#endif 242#endif
243 if (read(fd, &buffer[bufpos], 1) != 1) {
244 err = errno;
245 retval = (const char *)(uintptr_t)1;
246 break;
247 }
257 248
258 c = buffer[bufpos]; 249 c = buffer[bufpos];
259#if ENABLE_PLATFORM_MINGW32 250#if ENABLE_PLATFORM_MINGW32