diff options
Diffstat (limited to 'packet.c')
-rw-r--r-- | packet.c | 11 |
1 files changed, 8 insertions, 3 deletions
@@ -37,7 +37,7 @@ | |||
37 | */ | 37 | */ |
38 | 38 | ||
39 | #include "includes.h" | 39 | #include "includes.h" |
40 | RCSID("$OpenBSD: packet.c,v 1.50 2001/02/11 12:59:25 markus Exp $"); | 40 | RCSID("$OpenBSD: packet.c,v 1.51 2001/02/12 22:56:09 deraadt Exp $"); |
41 | 41 | ||
42 | #include "xmalloc.h" | 42 | #include "xmalloc.h" |
43 | #include "buffer.h" | 43 | #include "buffer.h" |
@@ -688,7 +688,9 @@ packet_read(int *payload_len_ptr) | |||
688 | FD_SET(connection_in, &set); | 688 | FD_SET(connection_in, &set); |
689 | 689 | ||
690 | /* Wait for some data to arrive. */ | 690 | /* Wait for some data to arrive. */ |
691 | select(connection_in + 1, &set, NULL, NULL, NULL); | 691 | while (select(connection_in + 1, &set, NULL, NULL, NULL) == -1 && |
692 | (errno == EAGAIN || errno == EINTR)) | ||
693 | ; | ||
692 | 694 | ||
693 | /* Read data from the socket. */ | 695 | /* Read data from the socket. */ |
694 | len = read(connection_in, buf, sizeof(buf)); | 696 | len = read(connection_in, buf, sizeof(buf)); |
@@ -1195,9 +1197,12 @@ packet_write_wait() | |||
1195 | packet_write_poll(); | 1197 | packet_write_poll(); |
1196 | while (packet_have_data_to_write()) { | 1198 | while (packet_have_data_to_write()) { |
1197 | fd_set set; | 1199 | fd_set set; |
1200 | |||
1198 | FD_ZERO(&set); | 1201 | FD_ZERO(&set); |
1199 | FD_SET(connection_out, &set); | 1202 | FD_SET(connection_out, &set); |
1200 | select(connection_out + 1, NULL, &set, NULL, NULL); | 1203 | while (select(connection_out + 1, NULL, &set, NULL, NULL) == -1 && |
1204 | (errno == EAGAIN || errno == EINTR)) | ||
1205 | ; | ||
1201 | packet_write_poll(); | 1206 | packet_write_poll(); |
1202 | } | 1207 | } |
1203 | } | 1208 | } |