net/SocketUtil: use SocketDescriptor::SetBoolOption()
This commit is contained in:
		@@ -42,9 +42,7 @@ socket_bind_listen(int domain, int type, int protocol,
 | 
				
			|||||||
		throw MakeSocketError("Failed to listen on socket");
 | 
							throw MakeSocketError("Failed to listen on socket");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#if defined(HAVE_STRUCT_UCRED) && defined(SO_PASSCRED)
 | 
					#if defined(HAVE_STRUCT_UCRED) && defined(SO_PASSCRED)
 | 
				
			||||||
	const int pass_cred = 1;
 | 
						fd.SetBoolOption(SOL_SOCKET, SO_PASSCRED, true);
 | 
				
			||||||
	setsockopt(fd.Get(), SOL_SOCKET, SO_PASSCRED,
 | 
					 | 
				
			||||||
		   (const char *) &pass_cred, sizeof(pass_cred));
 | 
					 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return fd;
 | 
						return fd;
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user