From: RĂ©mi Denis-Courmont Date: Sat, 9 Feb 2008 08:32:05 +0000 (+0000) Subject: Handle waitpipe error failures. X-Git-Tag: 0.9.0-test0~2771 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;ds=sidebyside;h=bd26b5fae425423ad406e2c2e2375ba47be31d17;hp=db3a33e450fb439432c6a7efe1652afc80aa0730;p=vlc Handle waitpipe error failures. --- diff --git a/src/network/io.c b/src/network/io.c index cb722f8c5e..032159322d 100644 --- a/src/network/io.c +++ b/src/network/io.c @@ -271,18 +271,17 @@ __net_Read (vlc_object_t *restrict p_this, int fd, const v_socket_t *vs, { size_t i_total = 0; struct pollfd ufd[2] = { - { .fd = fd, .events = POLLIN }, - { .fd = -1, .events = POLLIN }, + { .fd = fd, .events = POLLIN }, + { .fd = vlc_object_waitpipe (p_this), .events = POLLIN }, }; + if (ufd[1].fd == -1) + return -1; /* vlc_object_waitpipe() sets errno */ + while (i_buflen > 0) { int val; - ufd[1].fd = vlc_object_waitpipe (p_this); - if (ufd[1].fd == -1) - { - } ufd[0].revents = ufd[1].revents = 0; val = poll (ufd, sizeof (ufd) / sizeof (ufd[0]), -1);