aboutsummaryrefslogtreecommitdiffstats
path: root/camel/camel-stream-fs.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2001-10-28 15:03:32 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-28 15:03:32 +0800
commit2c2cdb4ee5692f72077c2afef8bea62ad5589766 (patch)
treecf8c78689582b854b8ce40378566eb9ffdd5aab0 /camel/camel-stream-fs.c
parent1d1fed5fb52dc3de130d59badfed22fb919942d4 (diff)
downloadgsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar.gz
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar.bz2
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar.lz
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar.xz
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.tar.zst
gsoc2013-evolution-2c2cdb4ee5692f72077c2afef8bea62ad5589766.zip
Same.
2001-10-28 Jeffrey Stedfast <fejj@ximian.com> * camel-tcp-stream-raw.c (stream_write): Same. * camel-stream-fs.c (stream_write): If errno isn't EAGAIN, just exit with -1 and instead of using continue (which doesn't go to the top of the do-while thus making our logic suck), just set w to 0. Still seems to be a bug in select() if it's telling us the socket is ready for data when it really isn't but oh well. svn path=/trunk/; revision=14286
Diffstat (limited to 'camel/camel-stream-fs.c')
-rw-r--r--camel/camel-stream-fs.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/camel/camel-stream-fs.c b/camel/camel-stream-fs.c
index 230d3ba6bd..b2eb9d5050 100644
--- a/camel/camel-stream-fs.c
+++ b/camel/camel-stream-fs.c
@@ -319,15 +319,19 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
} while (w == -1 && errno == EINTR);
if (w == -1) {
- if (errno == EAGAIN)
- continue;
+ if (errno == EAGAIN) {
+ w = 0;
+ } else {
+ error = errno;
+ fcntl (stream_fs->fd, F_SETFL, flags);
+ errno = error;
+ return -1;
+ }
} else
written += w;
} while (w != -1 && written < n);
- error = errno;
fcntl (stream_fs->fd, F_SETFL, flags);
- errno = error;
}
if (written > 0)