diff options
author | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-06 03:31:34 +0000 |
---|---|---|
committer | Ben Lindstrom <mouring@eviladmin.org> | 2001-03-06 03:31:34 +0000 |
commit | b3144e58e74ad9cc3c07da94264c3ccbfccb5cf7 (patch) | |
tree | 9ad479c3eef78443192fc92f20a281ac45cca8ed /cli.c | |
parent | be6a5a6dfe14c516b0982e57bb95f022bf19cf46 (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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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" @@ -134,12 +134,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; |