Commit d934fc52 authored by Derk-Jan Hartman's avatar Derk-Jan Hartman

poll(): ifndef HAVE_POLL means we don't use poll(), not that it doesn't exist....

poll(): ifndef HAVE_POLL means we don't use poll(), not that it doesn't exist. In OSX poll() is broken for sockets, so we don't use it. Since poll is a kernel function in OSX however, the kernel implementation was used whenever we used poll(), instead of VLCs private poll() which was the intended behaviour. Renamed poll() to vlc_poll() to prevent this.

This fixes #1687, receiving SAPs on Mac OS X.
parent 401d2c11
...@@ -235,4 +235,8 @@ typedef void *locale_t; ...@@ -235,4 +235,8 @@ typedef void *locale_t;
#define N_(str) gettext_noop (str) #define N_(str) gettext_noop (str)
#define gettext_noop(str) (str) #define gettext_noop(str) (str)
#ifndef HAVE_POLL
#define poll vlc_poll
#endif
#endif /* !LIBVLC_FIXUPS_H */ #endif /* !LIBVLC_FIXUPS_H */
...@@ -181,7 +181,7 @@ struct pollfd ...@@ -181,7 +181,7 @@ struct pollfd
int revents; int revents;
}; };
VLC_EXPORT (int, poll, (struct pollfd *fds, unsigned nfds, int timeout)); VLC_EXPORT (int, vlc_poll, (struct pollfd *fds, unsigned nfds, int timeout));
#endif #endif
#ifdef WIN32 #ifdef WIN32
......
...@@ -58,7 +58,12 @@ ...@@ -58,7 +58,12 @@
# include <sys/wait.h> # include <sys/wait.h>
# include <fcntl.h> # include <fcntl.h>
# include <sys/socket.h> # include <sys/socket.h>
# include <sys/poll.h> #ifdef HAVE_POLL
# include <poll.h>
#else
#undef _poll
#include <vlc_network.h>
#endif
#endif #endif
#if defined(WIN32) || defined(UNDER_CE) #if defined(WIN32) || defined(UNDER_CE)
......
...@@ -322,4 +322,8 @@ void vlc_rewinddir (void *); ...@@ -322,4 +322,8 @@ void vlc_rewinddir (void *);
# define rewinddir vlc_rewinddir # define rewinddir vlc_rewinddir
#endif #endif
#ifndef HAVE_POLL
# define _poll vlc_poll
#endif
#endif #endif
...@@ -278,7 +278,7 @@ playlist_ServicesDiscoveryRemove ...@@ -278,7 +278,7 @@ playlist_ServicesDiscoveryRemove
playlist_TreeMove playlist_TreeMove
__pl_Release __pl_Release
__pl_Yield __pl_Yield
poll vlc_poll
resolve_xml_special_chars resolve_xml_special_chars
sdp_AddAttribute sdp_AddAttribute
sdp_AddMedia sdp_AddMedia
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <vlc_network.h> #include <vlc_network.h>
int poll (struct pollfd *fds, unsigned nfds, int timeout) int vlc_poll (struct pollfd *fds, unsigned nfds, int timeout)
{ {
fd_set rdset, wrset, exset; fd_set rdset, wrset, exset;
struct timeval tv = { 0, 0 }; struct timeval tv = { 0, 0 };
......
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