summaryrefslogtreecommitdiff
path: root/imap/src/osdep
diff options
context:
space:
mode:
authorEduardo Chappa <chappa@washington.edu>2019-09-26 19:06:30 -0600
committerEduardo Chappa <chappa@washington.edu>2019-09-26 19:06:30 -0600
commit90e12ea2c85c9b3b43f82800873e329154527d1c (patch)
tree86abcb0b0d2bd9fe7b17835a55f28de14afeb94e /imap/src/osdep
parentb9de8dcc0aff082f61a638c9f0dd12b285cd6533 (diff)
downloadalpine-90e12ea2c85c9b3b43f82800873e329154527d1c.tar.xz
* Return a read() to be a read of one byte. The current code has a code
for a read of zero bytes, but this causes problems. Reported by Greg Oster.
Diffstat (limited to 'imap/src/osdep')
-rw-r--r--imap/src/osdep/unix/tcp_unix.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/imap/src/osdep/unix/tcp_unix.c b/imap/src/osdep/unix/tcp_unix.c
index 73791f60..c98b479c 100644
--- a/imap/src/osdep/unix/tcp_unix.c
+++ b/imap/src/osdep/unix/tcp_unix.c
@@ -312,7 +312,7 @@ int tcp_socket_open (int family,void *adr,size_t adrlen,unsigned short port,
/* This used to be a zero-byte read(), but that crashes Solaris */
/* get socket status */
if(FD_ISSET(sock,&rfds))
- while (((i = *ctr = read (sock,tmp,0)) < 0) && (errno == EINTR));
+ while (((i = *ctr = read (sock,tmp,1)) < 0) && (errno == EINTR));
}
if (i <= 0) { /* timeout or error? */
i = i ? errno : ETIMEDOUT;/* determine error code */