diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | cli.c | 12 |
2 files changed, 15 insertions, 5 deletions
@@ -1,3 +1,9 @@ | |||
1 | 20010509 | ||
2 | - OpenBSD CVS Sync | ||
3 | - markus@cvs.openbsd.org 2001/05/06 21:23:31 | ||
4 | [cli.c] | ||
5 | cli_read() fails to catch SIGINT + overflow; from obdb@zzlevo.net | ||
6 | |||
1 | 20010508 | 7 | 20010508 |
2 | - (bal) Fixed configure test for USE_SIA. | 8 | - (bal) Fixed configure test for USE_SIA. |
3 | 9 | ||
@@ -5357,4 +5363,4 @@ | |||
5357 | - Wrote replacements for strlcpy and mkdtemp | 5363 | - Wrote replacements for strlcpy and mkdtemp |
5358 | - Released 1.0pre1 | 5364 | - Released 1.0pre1 |
5359 | 5365 | ||
5360 | $Id: ChangeLog,v 1.1205 2001/05/07 12:54:26 mouring Exp $ | 5366 | $Id: ChangeLog,v 1.1206 2001/05/08 20:05:44 mouring Exp $ |
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: cli.c,v 1.12 2001/05/06 17:52:07 mouring Exp $ */ | 1 | /* $OpenBSD: cli.c,v 1.13 2001/05/06 21:23:31 markus 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.12 2001/05/06 17:52:07 mouring Exp $"); | 28 | RCSID("$OpenBSD: cli.c,v 1.13 2001/05/06 21:23:31 markus Exp $"); |
29 | 29 | ||
30 | #include "xmalloc.h" | 30 | #include "xmalloc.h" |
31 | #include "log.h" | 31 | #include "log.h" |
@@ -141,15 +141,19 @@ cli_read(char* buf, int size, int echo) | |||
141 | 141 | ||
142 | while (ch != '\n') { | 142 | while (ch != '\n') { |
143 | n = read(cli_input, &ch, 1); | 143 | n = read(cli_input, &ch, 1); |
144 | if (intr) | ||
145 | break; | ||
144 | if (n == -1 && (errno == EAGAIN || errno == EINTR)) | 146 | if (n == -1 && (errno == EAGAIN || errno == EINTR)) |
145 | continue; | 147 | continue; |
146 | if (n != 1) | 148 | if (n != 1) |
147 | break; | 149 | break; |
148 | if (ch == '\n' || intr != 0) | 150 | if (ch == '\n') |
149 | break; | 151 | break; |
150 | if (i < size) | 152 | if (i < size - 1) |
151 | buf[i++] = ch; | 153 | buf[i++] = ch; |
152 | } | 154 | } |
155 | if (intr) | ||
156 | i = 0; | ||
153 | buf[i] = '\0'; | 157 | buf[i] = '\0'; |
154 | 158 | ||
155 | if (!echo) | 159 | if (!echo) |