summaryrefslogtreecommitdiffstats
path: root/crypto/openssh/authfd.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2004-10-28 16:11:31 +0000
committerdes <des@FreeBSD.org>2004-10-28 16:11:31 +0000
commita744ec13ade7d70128cd82393862d02c1f712f6a (patch)
tree2b93d7eeb78a97c2cc9e93d61346f39150ed165f /crypto/openssh/authfd.c
parentca12ec184bb7b4d1d0ff5dc213f5da06de091b8c (diff)
downloadFreeBSD-src-a744ec13ade7d70128cd82393862d02c1f712f6a.zip
FreeBSD-src-a744ec13ade7d70128cd82393862d02c1f712f6a.tar.gz
Resolve conflicts
Diffstat (limited to 'crypto/openssh/authfd.c')
-rw-r--r--crypto/openssh/authfd.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/crypto/openssh/authfd.c b/crypto/openssh/authfd.c
index 42ca082..662350c 100644
--- a/crypto/openssh/authfd.c
+++ b/crypto/openssh/authfd.c
@@ -35,7 +35,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: authfd.c,v 1.63 2003/11/21 11:57:03 djm Exp $");
+RCSID("$OpenBSD: authfd.c,v 1.64 2004/08/11 21:44:31 avsm Exp $");
#include <openssl/evp.h>
@@ -133,16 +133,9 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
* Wait for response from the agent. First read the length of the
* response packet.
*/
- len = 4;
- while (len > 0) {
- l = read(auth->fd, buf + 4 - len, len);
- if (l == -1 && (errno == EAGAIN || errno == EINTR))
- continue;
- if (l <= 0) {
- error("Error reading response length from authentication socket.");
- return 0;
- }
- len -= l;
+ if (atomicio(read, auth->fd, buf, 4) != 4) {
+ error("Error reading response length from authentication socket.");
+ return 0;
}
/* Extract the length, and check it for sanity. */
@@ -156,9 +149,7 @@ ssh_request_reply(AuthenticationConnection *auth, Buffer *request, Buffer *reply
l = len;
if (l > sizeof(buf))
l = sizeof(buf);
- l = read(auth->fd, buf, l);
- if (l == -1 && (errno == EAGAIN || errno == EINTR))
- continue;
+ l = atomicio(read, auth->fd, buf, l);
if (l <= 0) {
error("Error reading response from authentication socket.");
return 0;
OpenPOWER on IntegriCloud