=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/authfd.c,v retrieving revision 1.63 retrieving revision 1.63.2.1 diff -u -r1.63 -r1.63.2.1 --- src/usr.bin/ssh/authfd.c 2003/11/21 11:57:03 1.63 +++ src/usr.bin/ssh/authfd.c 2004/08/19 04:13:26 1.63.2.1 @@ -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.63.2.1 2004/08/19 04:13:26 brad Exp $"); #include @@ -133,16 +133,9 @@ * 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 @@ 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;