diff options
author | 2001-03-06 00:33:03 +0000 | |
---|---|---|
committer | 2001-03-06 00:33:03 +0000 | |
commit | bc8e9e804072a01c34e44f0afc3432f5f3fe17d0 (patch) | |
tree | 2d67dfa09d596daabc0d00b8271e161fc55b4d38 /usr.bin/ssh/cli.c | |
parent | sync (diff) | |
download | wireguard-openbsd-bc8e9e804072a01c34e44f0afc3432f5f3fe17d0.tar.xz wireguard-openbsd-bc8e9e804072a01c34e44f0afc3432f5f3fe17d0.zip |
EINTR/EAGAIN handling is required in more cases
Diffstat (limited to 'usr.bin/ssh/cli.c')
-rw-r--r-- | usr.bin/ssh/cli.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/ssh/cli.c b/usr.bin/ssh/cli.c index 620431e9bf2..8f0b2b87e36 100644 --- a/usr.bin/ssh/cli.c +++ b/usr.bin/ssh/cli.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $ */ +/* $OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $ */ /* * Copyright (c) 2000 Markus Friedl. All rights reserved. @@ -25,7 +25,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: cli.c,v 1.10 2001/03/01 03:38:33 deraadt Exp $"); +RCSID("$OpenBSD: cli.c,v 1.11 2001/03/06 00:33:04 deraadt Exp $"); #include "xmalloc.h" #include "log.h" @@ -136,12 +136,16 @@ cli_read(char* buf, int size, int echo) { char ch = 0; int i = 0; + int n; if (!echo) cli_echo_disable(); while (ch != '\n') { - if (read(cli_input, &ch, 1) != 1) + n = read(cli_input, &ch, 1); + if (n == -1 && (errno == EAGAIN || errno == EINTR)) + continue; + if (n != 1) break; if (ch == '\n' || intr != 0) break; |