diff options
author | Max Kellermann <max@musicpd.org> | 2017-08-10 13:22:00 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2017-08-10 13:22:00 +0200 |
commit | d84dae488e7080495898bc24dea95d5b173873c2 (patch) | |
tree | ba055b13137b68f1d5ae79d34780951cfd41a7f5 /src/net/SocketUtil.cxx | |
parent | 79e75bfbb9a62b0f4c996f2e43152937f8667a43 (diff) |
net/SocketUtil: fix -Wunused
Diffstat (limited to 'src/net/SocketUtil.cxx')
-rw-r--r-- | src/net/SocketUtil.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/net/SocketUtil.cxx b/src/net/SocketUtil.cxx index 559ac82de..ab029cdea 100644 --- a/src/net/SocketUtil.cxx +++ b/src/net/SocketUtil.cxx @@ -28,8 +28,6 @@ socket_bind_listen(int domain, int type, int protocol, SocketAddress address, int backlog) { - const int reuse = 1; - UniqueSocketDescriptor fd; if (!fd.CreateNonBlock(domain, type, protocol)) throw MakeSocketError("Failed to create socket"); @@ -44,8 +42,9 @@ socket_bind_listen(int domain, int type, int protocol, throw MakeSocketError("Failed to listen on socket"); #if defined(HAVE_STRUCT_UCRED) && defined(SO_PASSCRED) + const int pass_cred = 1; setsockopt(fd.Get(), SOL_SOCKET, SO_PASSCRED, - (const char *) &reuse, sizeof(reuse)); + (const char *) &pass_cred, sizeof(pass_cred)); #endif return fd; |