mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-06-03 14:42:01 +03:00
poll: Do not generate SIGPIPE with recv() in bsd_poll()
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
parent
edc7b96b2f
commit
51f035aa3f
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user