Commit 8848d74e authored by Philipp Schafft's avatar Philipp Schafft 🦁

Fix: Correctly detect error condition

parent 4279a6ca
......@@ -358,9 +358,10 @@ int listensocket_refsock(listensocket_t *self)
if (self->sock == SOCK_ERROR)
return -1;
if (sock_listen(self->sock, ICECAST_LISTEN_QUEUE) == SOCK_ERROR) {
if (sock_listen(self->sock, ICECAST_LISTEN_QUEUE) == 0) {
sock_close(self->sock);
self->sock = SOCK_ERROR;
ICECAST_LOG_ERROR("Can not listen on socket: %s port %i", self->listener->bind_address ? self->listener->bind_address : "<ANY>", self->listener->port);
return -1;
}
......
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