aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@src.gnome.org>2001-10-30 12:24:28 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2001-10-30 12:24:28 +0800
commitc779a57f33182f206d9a0427e194b06ed3c84118 (patch)
treee6b52723884ceaa315c1359135d79a956dfa79e2
parent5cd2e1cb3955fc95eeca42b254530e69c6627d25 (diff)
downloadgsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar.gz
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar.bz2
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar.lz
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar.xz
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.tar.zst
gsoc2013-evolution-c779a57f33182f206d9a0427e194b06ed3c84118.zip
fixed a compile problem and saved errno before calling fcntl() in stream_read
svn path=/trunk/; revision=14418
-rw-r--r--camel/camel-tcp-stream-openssl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/camel/camel-tcp-stream-openssl.c b/camel/camel-tcp-stream-openssl.c
index 17d5ab0961..e7dab0aaf7 100644
--- a/camel/camel-tcp-stream-openssl.c
+++ b/camel/camel-tcp-stream-openssl.c
@@ -176,7 +176,8 @@ errlib_error_to_errno (int ret)
if (error == 0) {
if (ret == 0)
errno = EINVAL; /* unexpected EOF */
- errno = 0;
+ else
+ errno = 0;
} else if (!errno) {
/* ok, we get the shaft now. */
errno = EINTR;
@@ -231,7 +232,7 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
ssl_error_to_errno (ssl, nread);
} while (nread < 0 && (errno == EINTR || errno == EAGAIN || errno == EWOULDBLOCK));
} else {
- int flags, fdmax;
+ int error, flags, fdmax;
fd_set rdset;
flags = fcntl (tcp_stream_openssl->priv->sockfd, F_GETFL);
@@ -257,7 +258,9 @@ stream_read (CamelStream *stream, char *buffer, size_t n)
} while (nread < 0 && errno == EINTR);
} while (nread < 0 && (errno == EAGAIN || errno == EWOULDBLOCK));
+ error = errno;
fcntl (tcp_stream_openssl->priv->sockfd, F_SETFL, flags);
+ errno = error;
}
return nread;
@@ -290,7 +293,7 @@ stream_write (CamelStream *stream, const char *buffer, size_t n)
} while (w != -1 && written < n);
} else {
fd_set rdset, wrset;
- int flags, fdmax;
+ int error, flags, fdmax;
flags = fcntl (tcp_stream_openssl->priv->sockfd, F_GETFL);
fcntl (tcp_stream_openssl->priv->sockfd, F_SETFL, flags | O_NONBLOCK);