# include "config.h"
#endif
-#ifdef HAVE_POLL
+#include <vlc_common.h>
#include <stdlib.h>
+#include <vlc_network.h>
+
+#ifdef HAVE_POLL
struct pollfd;
int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
}
#else /* !HAVE_POLL */
-#include <vlc_common.h>
#include <string.h>
-#include <stdlib.h>
-#include <vlc_network.h>
int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
{
fd_set rdset, wrset, exset;
struct timeval tv = { 0, 0 };
- int val = -1;
+ int val;
+
+resume:
+ val = -1;
+ vlc_testcancel ();
FD_ZERO (&rdset);
FD_ZERO (&wrset);
#ifndef HAVE_ALERTABLE_SELECT
# warning FIXME! Fix cancellation and remove this crap.
-resume:
- vlc_testcancel ();
-
if ((timeout < 0) || (timeout > 50))
{
tv.tv_sec = 0;
- tv.tv_usec = 50;
+ tv.tv_usec = 50000;
}
else
#endif
}
val = select (val + 1, &rdset, &wrset, &exset,
- (timeout >= 0) ? &tv : NULL);
+ /*(timeout >= 0) ?*/ &tv /*: NULL*/);
#ifndef HAVE_ALERTABLE_SELECT
-# warning FIXME! Fix cancellation and remove this crap.
if (val == 0)
{
if (timeout > 0)