# include "config.h"
#endif
-#include <vlc_common.h>
-
#ifdef HAVE_POLL
+#include <stdlib.h>
+
struct pollfd;
int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
abort ();
}
#else /* !HAVE_POLL */
+
+#include <vlc_common.h>
#include <string.h>
#include <stdlib.h>
#include <vlc_network.h>
FD_SET (fd, &exset);
}
+#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;
+ }
+ else
+#endif
if (timeout >= 0)
{
div_t d = div (timeout, 1000);
val = select (val + 1, &rdset, &wrset, &exset,
(timeout >= 0) ? &tv : NULL);
+
+#ifndef HAVE_ALERTABLE_SELECT
+# warning FIXME! Fix cancellation and remove this crap.
+ if (val == 0)
+ {
+ if (timeout > 0)
+ timeout -= (timeout > 50) ? 50 : timeout;
+ if (timeout != 0)
+ goto resume;
+ }
+#endif
+
if (val == -1)
return -1;