aboutsummaryrefslogtreecommitdiff
path: root/shell/shell_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r--shell/shell_common.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index e5c2cefb3..9a03f7265 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -204,8 +204,8 @@ shell_builtin_read(struct builtin_read_params *params)
204 * 32-bit unix time wrapped (year 2038+). 204 * 32-bit unix time wrapped (year 2038+).
205 */ 205 */
206 if (timeout <= 0) { /* already late? */ 206 if (timeout <= 0) { /* already late? */
207 retval = (const char *)(uintptr_t)1; 207 retval = (const char *)(uintptr_t)2;
208 goto ret; 208 break;
209 } 209 }
210 } 210 }
211 211
@@ -217,8 +217,12 @@ shell_builtin_read(struct builtin_read_params *params)
217 pfd[0].events = POLLIN; 217 pfd[0].events = POLLIN;
218//TODO race with a signal arriving just before the poll! 218//TODO race with a signal arriving just before the poll!
219 if (poll(pfd, 1, timeout) <= 0) { 219 if (poll(pfd, 1, timeout) <= 0) {
220 /* timed out, or EINTR */ 220 /* timed out, or some error */
221 err = errno; 221 err = errno;
222 if (!err) {
223 retval = (const char *)(uintptr_t)2;
224 break;
225 }
222 retval = (const char *)(uintptr_t)1; 226 retval = (const char *)(uintptr_t)1;
223 goto ret; 227 goto ret;
224 } 228 }