Cast boolean into int directly in function set_passcred
This commit is contained in:
parent
d0b133cdc6
commit
e61148f98a
1 changed files with 1 additions and 2 deletions
|
@ -324,8 +324,7 @@ impl Socket {
|
|||
}
|
||||
|
||||
pub fn set_passcred(&self, passcred: bool) -> io::Result<()> {
|
||||
let boolean: libc::c_int = if passcred { 1 } else { 0 };
|
||||
setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, boolean)
|
||||
setsockopt(self, libc::SOL_SOCKET, libc::SO_PASSCRED, passcred as libc::c_int)
|
||||
}
|
||||
|
||||
pub fn passcred(&self) -> io::Result<bool> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue