aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/poll.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/poll.c b/src/poll.c
index e3f5262e..01eb42d5 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -172,14 +172,19 @@ static short bsd_socket_compute_revents(int fd, short events)
int sock_errno = errno;
char data[64] = {0};
short revents = 0;
+ int flags = MSG_PEEK;
int ret;
+#ifdef MSG_NOSIGNAL
+ flags |= MSG_NOSIGNAL;
+#endif
+
/* support for POLLHUP */
#ifdef _WIN32
WSASetLastError(0);
#endif
- ret = recv(fd, data, 64, MSG_PEEK);
+ ret = recv(fd, data, 64, flags);
errno = save_errno;