From 90e12ea2c85c9b3b43f82800873e329154527d1c Mon Sep 17 00:00:00 2001 From: Eduardo Chappa Date: Thu, 26 Sep 2019 19:06:30 -0600 Subject: * 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. --- imap/src/osdep/unix/tcp_unix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'imap/src/osdep/unix/tcp_unix.c') 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 */ -- cgit v1.2.3-54-g00ecf