diff options
Diffstat (limited to 'ssh-agent.c')
-rw-r--r-- | ssh-agent.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/ssh-agent.c b/ssh-agent.c index a558ecef7..5a774d570 100644 --- a/ssh-agent.c +++ b/ssh-agent.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $ */ | 1 | /* $OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> | 4 | * Author: Tatu Ylonen <ylo@cs.hut.fi> |
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include "includes.h" | 39 | #include "includes.h" |
40 | RCSID("$OpenBSD: ssh-agent.c,v 1.51 2001/03/02 18:54:31 deraadt Exp $"); | 40 | RCSID("$OpenBSD: ssh-agent.c,v 1.52 2001/03/06 00:33:04 deraadt Exp $"); |
41 | 41 | ||
42 | #include <openssl/evp.h> | 42 | #include <openssl/evp.h> |
43 | #include <openssl/md5.h> | 43 | #include <openssl/md5.h> |
@@ -635,9 +635,15 @@ after_select(fd_set *readset, fd_set *writeset) | |||
635 | case AUTH_CONNECTION: | 635 | case AUTH_CONNECTION: |
636 | if (buffer_len(&sockets[i].output) > 0 && | 636 | if (buffer_len(&sockets[i].output) > 0 && |
637 | FD_ISSET(sockets[i].fd, writeset)) { | 637 | FD_ISSET(sockets[i].fd, writeset)) { |
638 | len = write(sockets[i].fd, | 638 | do { |
639 | buffer_ptr(&sockets[i].output), | 639 | len = write(sockets[i].fd, |
640 | buffer_len(&sockets[i].output)); | 640 | buffer_ptr(&sockets[i].output), |
641 | buffer_len(&sockets[i].output)); | ||
642 | if (len == -1 && (errno == EAGAIN || | ||
643 | errno == EINTR)) | ||
644 | continue; | ||
645 | break; | ||
646 | } while (1); | ||
641 | if (len <= 0) { | 647 | if (len <= 0) { |
642 | shutdown(sockets[i].fd, SHUT_RDWR); | 648 | shutdown(sockets[i].fd, SHUT_RDWR); |
643 | close(sockets[i].fd); | 649 | close(sockets[i].fd); |
@@ -649,7 +655,13 @@ after_select(fd_set *readset, fd_set *writeset) | |||
649 | buffer_consume(&sockets[i].output, len); | 655 | buffer_consume(&sockets[i].output, len); |
650 | } | 656 | } |
651 | if (FD_ISSET(sockets[i].fd, readset)) { | 657 | if (FD_ISSET(sockets[i].fd, readset)) { |
652 | len = read(sockets[i].fd, buf, sizeof(buf)); | 658 | do { |
659 | len = read(sockets[i].fd, buf, sizeof(buf)); | ||
660 | if (len == -1 && (errno == EAGAIN || | ||
661 | errno == EINTR)) | ||
662 | continue; | ||
663 | break; | ||
664 | } while (1); | ||
653 | if (len <= 0) { | 665 | if (len <= 0) { |
654 | shutdown(sockets[i].fd, SHUT_RDWR); | 666 | shutdown(sockets[i].fd, SHUT_RDWR); |
655 | close(sockets[i].fd); | 667 | close(sockets[i].fd); |