mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-25 20:16:14 -05:00
[misc] Use fcntl+O_NONBLOCK when binding instead of socket+SOCK_NONBLOCK
socket() with SOCK_NONBLOCK (O_NONBLOCK) seems not to be possible on MacOS, it yields 'Protocol wrong type for socket'. Switch to using fcntl() and O_NONBLOCK instead, hopefully works better cross-platform. Closes #1644
This commit is contained in:
@@ -15,15 +15,6 @@
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifndef SOCK_NONBLOCK
|
||||
#include <fcntl.h>
|
||||
#define SOCK_NONBLOCK O_NONBLOCK
|
||||
#endif
|
||||
|
||||
#ifndef SOCK_CLOEXEC
|
||||
#define SOCK_CLOEXEC 0
|
||||
#endif
|
||||
|
||||
union net_sockaddr
|
||||
{
|
||||
struct sockaddr_in sin;
|
||||
|
||||
Reference in New Issue
Block a user