aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-tcp-stream-raw.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2001-10-17 12:09:17 +0800
committerMichael Zucci <zucchi@src.gnome.org>2001-10-17 12:09:17 +0800
commit846fe128cb00fcbe020b47826dd3de50d4704a48 (patch)
tree66458e4e81043859b91e850541d5130b3aebd09f /camel/camel-tcp-stream-raw.c
parentba196c905ab7f0a522b5dd7eec043978813fb262 (diff)
downloadgsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar.gz
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar.bz2
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar.lz
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar.xz
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.tar.zst
gsoc2013-evolution-846fe128cb00fcbe020b47826dd3de50d4704a48.zip
As below.
2001-10-17 Not Zed <NotZed@Ximian.com> * camel-tcp-stream-raw.c (stream_write): As below. * camel-stream-fs.c (stream_write): If not checking cancellation, make sure we write out everything asked of us. svn path=/trunk/; revision=13717
Diffstat (limited to 'camel/camel-tcp-stream-raw.c')
-rw-r--r--camel/camel-tcp-stream-raw.c9
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;