net/SocketUtil: use SocketDescriptor::SetBoolOption()

This commit is contained in:
Max Kellermann 2017-08-10 19:30:46 +02:00
parent 1f47dc990d
commit cf0120e8e0
1 changed files with 1 additions and 3 deletions

View File

@ -42,9 +42,7 @@ 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 *) &pass_cred, sizeof(pass_cred));
fd.SetBoolOption(SOL_SOCKET, SO_PASSCRED, true);
#endif
return fd;