summaryrefslogtreecommitdiff
path: root/cli.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-06 03:31:34 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-06 03:31:34 +0000
commitb3144e58e74ad9cc3c07da94264c3ccbfccb5cf7 (patch)
tree9ad479c3eef78443192fc92f20a281ac45cca8ed /cli.c
parentbe6a5a6dfe14c516b0982e57bb95f022bf19cf46 (diff)
- deraadt@cvs.openbsd.org 2001/03/06 00:33:04
[authfd.c cli.c ssh-agent.c] EINTR/EAGAIN handling is required in more cases
Diffstat (limited to 'cli.c')
-rw-r--r--cli.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/cli.c b/cli.c
index 915b34b14..d0f0cf3ff 100644
--- a/cli.c
+++ b/cli.c
@@ -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"
28RCSID("$OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $"); 28RCSID("$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;