fixup build on macos

This commit is contained in:
Wez Furlong committed 2021-05-23 14:42:41 -07:00
1 parent 5aa1912a5c
commit e046570fa1
1 file changed
+3 -9
+3 -9
View File
@@ -321,10 +321,7 @@ impl Pipe {
let mut fds = [-1i32; 2];
let res = unsafe { libc::pipe(fds.as_mut_ptr()) };
if res == -1 {
bail!(
"failed to create a pipe: {:?}",
std::io::Error::last_os_error()
)
Err(Error::Pipe(std::io::Error::last_os_error()))
} else {
let mut read = FileDescriptor {
handle: OwnedHandle {
@@ -382,10 +379,7 @@ pub fn socketpair_impl() -> Result<(FileDescriptor, FileDescriptor)> {
let mut fds = [-1i32; 2];
let res = unsafe { libc::socketpair(libc::PF_LOCAL, libc::SOCK_STREAM, 0, fds.as_mut_ptr()) };
if res == -1 {
bail!(
"failed to create a socketpair: {:?}",
std::io::Error::last_os_error()
)
Err(Error::Socketpair(std::io::Error::last_os_error()))
} else {
let mut read = FileDescriptor {
handle: OwnedHandle {
@@ -443,7 +437,7 @@ mod macos {
if fd < 0 {
return Err(Error::IllegalFdValue(fd.into()));
}
if fd >= FD_SETSIZE {
if fd as usize >= FD_SETSIZE {
return Err(Error::FdValueOutsideFdSetSize(fd.into()));
}
Ok(())