Commit c0e768b8 authored by Frédéric Yhuel's avatar Frédéric Yhuel Committed by Rémi Denis-Courmont

network/io.c: minor fix

Unlike POLLERR, POLLHUP, and POLLNVAL, POLLRDHUP is not set by default.
See http://man7.org/linux/man-pages/man2/poll.2.htmlSigned-off-by: default avatarRémi Denis-Courmont <remi@remlab.net>
parent cd0112a5
...@@ -257,9 +257,12 @@ ssize_t ...@@ -257,9 +257,12 @@ ssize_t
net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
void *restrict p_buf, size_t i_buflen, bool waitall) void *restrict p_buf, size_t i_buflen, bool waitall)
{ {
#ifndef POLLRDHUP /* This is nice but non-portable */
# define POLLRDHUP 0
#endif
size_t i_total = 0; size_t i_total = 0;
struct pollfd ufd[2] = { struct pollfd ufd[2] = {
{ .fd = fd, .events = POLLIN }, { .fd = fd, .events = POLLIN|POLLRDHUP },
{ .fd = vlc_object_waitpipe (p_this), .events = POLLIN }, { .fd = vlc_object_waitpipe (p_this), .events = POLLIN },
}; };
...@@ -277,9 +280,6 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, ...@@ -277,9 +280,6 @@ net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs,
continue; continue;
} }
#ifndef POLLRDHUP /* This is nice but non-portable */
# define POLLRDHUP 0
#endif
if (i_total > 0) if (i_total > 0)
{ {
/* Errors (-1) and EOF (0) will be returned on next call, /* Errors (-1) and EOF (0) will be returned on next call,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment