diff options
Diffstat (limited to 'camel/camel-tcp-stream-raw.c')
-rw-r--r-- | camel/camel-tcp-stream-raw.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/camel/camel-tcp-stream-raw.c b/camel/camel-tcp-stream-raw.c index 0aa9c2e1e5..34ba1446c5 100644 --- a/camel/camel-tcp-stream-raw.c +++ b/camel/camel-tcp-stream-raw.c @@ -188,8 +188,13 @@ stream_write (CamelStream *stream, const char *buffer, size_t n) cancel_fd = camel_operation_cancel_fd (NULL); if (cancel_fd == -1) { do { - written = write (tcp_stream_raw->sockfd, buffer, n); - } while (written == -1 && errno == EINTR); + do { + w = write (tcp_stream_raw->sockfd, buffer+written, n-written); + } while (w == -1 && errno == EINTR); + + if (w > 0) + written += w; + } while (w != -1 && written < n); } else { fd_set rdset, wrset; int flags, fdmax; |