net/SocketUtil: use SocketDescriptor::SetBoolOption()
This commit is contained in:
parent
1f47dc990d
commit
cf0120e8e0
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue