=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/ssh-agent.c,v retrieving revision 1.37.2.2 retrieving revision 1.37.2.3 diff -u -r1.37.2.2 -r1.37.2.3 --- src/usr.bin/ssh/ssh-agent.c 2001/02/19 17:19:27 1.37.2.2 +++ src/usr.bin/ssh/ssh-agent.c 2001/03/21 19:46:29 1.37.2.3 @@ -1,4 +1,4 @@ -/* $OpenBSD: ssh-agent.c,v 1.37.2.2 2001/02/19 17:19:27 jason Exp $ */ +/* $OpenBSD: ssh-agent.c,v 1.37.2.3 2001/03/21 19:46:29 jason Exp $ */ /* * Author: Tatu Ylonen @@ -13,7 +13,7 @@ * called by a name other than "ssh" or "Secure Shell". * * SSH2 implementation, - * Copyright (c) 2000 Markus Friedl. All rights reserved. + * Copyright (c) 2000 Markus Friedl. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-agent.c,v 1.37.2.2 2001/02/19 17:19:27 jason Exp $"); +RCSID("$OpenBSD: ssh-agent.c,v 1.37.2.3 2001/03/21 19:46:29 jason Exp $"); #include #include @@ -631,9 +631,15 @@ case AUTH_CONNECTION: if (buffer_len(&sockets[i].output) > 0 && FD_ISSET(sockets[i].fd, writeset)) { - len = write(sockets[i].fd, - buffer_ptr(&sockets[i].output), - buffer_len(&sockets[i].output)); + do { + len = write(sockets[i].fd, + buffer_ptr(&sockets[i].output), + buffer_len(&sockets[i].output)); + if (len == -1 && (errno == EAGAIN || + errno == EINTR)) + continue; + break; + } while (1); if (len <= 0) { shutdown(sockets[i].fd, SHUT_RDWR); close(sockets[i].fd); @@ -645,7 +651,13 @@ buffer_consume(&sockets[i].output, len); } if (FD_ISSET(sockets[i].fd, readset)) { - len = read(sockets[i].fd, buf, sizeof(buf)); + do { + len = read(sockets[i].fd, buf, sizeof(buf)); + if (len == -1 && (errno == EAGAIN || + errno == EINTR)) + continue; + break; + } while (1); if (len <= 0) { shutdown(sockets[i].fd, SHUT_RDWR); close(sockets[i].fd);