diff options
Diffstat (limited to 'cli.c')
-rw-r--r-- | cli.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $ */ | 1 | /* $OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. | 4 | * Copyright (c) 2000 Markus Friedl. All rights reserved. |
@@ -25,7 +25,7 @@ | |||
25 | */ | 25 | */ |
26 | 26 | ||
27 | #include "includes.h" | 27 | #include "includes.h" |
28 | RCSID("$OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $"); | 28 | RCSID("$OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $"); |
29 | 29 | ||
30 | #include "xmalloc.h" | 30 | #include "xmalloc.h" |
31 | #include "log.h" | 31 | #include "log.h" |
@@ -134,12 +134,16 @@ cli_read(char* buf, int size, int echo) | |||
134 | { | 134 | { |
135 | char ch = 0; | 135 | char ch = 0; |
136 | int i = 0; | 136 | int i = 0; |
137 | int n; | ||
137 | 138 | ||
138 | if (!echo) | 139 | if (!echo) |
139 | cli_echo_disable(); | 140 | cli_echo_disable(); |
140 | 141 | ||
141 | while (ch != '\n') { | 142 | while (ch != '\n') { |
142 | if (read(cli_input, &ch, 1) != 1) | 143 | n = read(cli_input, &ch, 1); |
144 | if (n == -1 && (errno == EAGAIN || errno == EINTR)) | ||
145 | continue; | ||
146 | if (n != 1) | ||
143 | break; | 147 | break; |
144 | if (ch == '\n' || intr != 0) | 148 | if (ch == '\n' || intr != 0) |
145 | break; | 149 | break; |