From 4c8cff14ddac08f1bdb393d71d9e0907d9a9215e Mon Sep 17 00:00:00 2001 From: Ben Lindstrom Date: Tue, 17 Apr 2001 18:09:42 +0000 Subject: - markus@cvs.openbsd.org 2001/04/17 09:52:48 [clientloop.c] handle EINTR/EAGAIN on read; ok deraadt@ --- ChangeLog | 5 ++++- clientloop.c | 8 +++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea589346c..f5d9863ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,9 @@ - markus@cvs.openbsd.org 2001/04/17 08:14:01 [sshconnect1.c] check for key!=NULL, thanks to costa + - markus@cvs.openbsd.org 2001/04/17 09:52:48 + [clientloop.c] + handle EINTR/EAGAIN on read; ok deraadt@ 20010416 - OpenBSD CVS Sync @@ -5134,4 +5137,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1132 2001/04/17 18:08:15 mouring Exp $ +$Id: ChangeLog,v 1.1133 2001/04/17 18:09:42 mouring Exp $ diff --git a/clientloop.c b/clientloop.c index 95c00f343..2709ce356 100644 --- a/clientloop.c +++ b/clientloop.c @@ -59,7 +59,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: clientloop.c,v 1.63 2001/04/15 17:16:00 markus Exp $"); +RCSID("$OpenBSD: clientloop.c,v 1.64 2001/04/17 09:52:48 markus Exp $"); #include "ssh.h" #include "ssh1.h" @@ -625,6 +625,8 @@ client_process_input(fd_set * readset) if (FD_ISSET(fileno(stdin), readset)) { /* Read as much as possible. */ len = read(fileno(stdin), buf, sizeof(buf)); + if (len < 0 && (errno == EAGAIN || errno == EINTR)) + return; /* we'll try again later */ if (len <= 0) { /* * Received EOF or error. They are treated @@ -678,7 +680,7 @@ client_process_output(fd_set * writeset) len = write(fileno(stdout), buffer_ptr(&stdout_buffer), buffer_len(&stdout_buffer)); if (len <= 0) { - if (errno == EAGAIN) + if (errno == EINTR || errno == EAGAIN) len = 0; else { /* @@ -701,7 +703,7 @@ client_process_output(fd_set * writeset) len = write(fileno(stderr), buffer_ptr(&stderr_buffer), buffer_len(&stderr_buffer)); if (len <= 0) { - if (errno == EAGAIN) + if (errno == EINTR || errno == EAGAIN) len = 0; else { /* EOF or error, but can't even print error message. */ -- cgit v1.2.3