diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-10 09:53:09 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-10 13:12:13 +0200 |
commit | da90f484aac5e605894a63e866c4d60bc1b30d57 (patch) | |
tree | f98f149d1fdfde8a8acbbb6d2c03d2dfd6f37d5b /src/event | |
parent | 817e9120259fa601922295b791bebc2f77392152 (diff) |
net/SocketUtil: socket_bind_listen() returns UniqueSocketDescriptor
Diffstat (limited to 'src/event')
-rw-r--r-- | src/event/ServerSocket.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/event/ServerSocket.cxx b/src/event/ServerSocket.cxx index 556648cc4..2890d4772 100644 --- a/src/event/ServerSocket.cxx +++ b/src/event/ServerSocket.cxx @@ -24,6 +24,7 @@ #include "net/SocketAddress.hxx" #include "net/SocketUtil.hxx" #include "net/SocketError.hxx" +#include "net/UniqueSocketDescriptor.hxx" #include "net/Resolver.hxx" #include "net/ToString.hxx" #include "event/SocketMonitor.hxx" @@ -185,9 +186,9 @@ OneServerSocket::Open() { assert(!IsDefined()); - int _fd = socket_bind_listen(address.GetFamily(), - SOCK_STREAM, 0, - address, 5); + auto _fd = socket_bind_listen(address.GetFamily(), + SOCK_STREAM, 0, + address, 5); #ifdef HAVE_UN /* allow everybody to connect */ @@ -198,7 +199,7 @@ OneServerSocket::Open() /* register in the EventLoop */ - SetFD(_fd); + SetFD(_fd.Steal()); } ServerSocket::ServerSocket(EventLoop &_loop) |