mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-24 03:27:46 -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:
@@ -4813,7 +4813,7 @@ mpd_init(void)
|
||||
CHECK_NULL(L_MPD, evbase_mpd = event_base_new());
|
||||
CHECK_NULL(L_MPD, cmdbase = commands_base_new(evbase_mpd, NULL));
|
||||
|
||||
mpd_sockfd = net_bind(&port, SOCK_STREAM | SOCK_NONBLOCK, "mpd");
|
||||
mpd_sockfd = net_bind(&port, SOCK_STREAM, "mpd");
|
||||
if (mpd_sockfd < 0)
|
||||
{
|
||||
DPRINTF(E_LOG, L_MPD, "Could not bind mpd server to port %hu\n", port);
|
||||
|
||||
Reference in New Issue
Block a user