Fix compilation
This commit is contained in:
@@ -269,4 +269,3 @@ impl<'a, 'b> SchemeSocket for IcmpSocket<'a, 'b> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,10 +106,10 @@ type WaitQueue = Vec<WaitHandle>;
|
||||
|
||||
type WaitQueueMap = BTreeMap<SocketHandle, WaitQueue>;
|
||||
|
||||
pub type DupResult<T> = (
|
||||
pub type DupResult<T> = Option<(
|
||||
SchemeFile<T>,
|
||||
Option<(SocketHandle, <T as SchemeSocket>::DataT)>,
|
||||
);
|
||||
)>;
|
||||
|
||||
pub trait SchemeSocket
|
||||
where
|
||||
@@ -639,12 +639,15 @@ where
|
||||
}),
|
||||
None,
|
||||
),
|
||||
_ => SocketT::dup(
|
||||
_ => match SocketT::dup(
|
||||
&mut self.socket_set.borrow_mut(),
|
||||
file,
|
||||
path,
|
||||
&mut self.scheme_data,
|
||||
)?,
|
||||
)? {
|
||||
Some(some) => some,
|
||||
None => return Ok(None),
|
||||
},
|
||||
};
|
||||
|
||||
if let Some((socket_handle, data)) = update_with {
|
||||
|
||||
@@ -162,7 +162,7 @@ impl<'a> SchemeSocket for TcpSocket<'a> {
|
||||
if tcp_handle.flags & syscall::O_NONBLOCK == syscall::O_NONBLOCK {
|
||||
return Err(SyscallError::new(syscall::EAGAIN));
|
||||
} else {
|
||||
Ok(None);
|
||||
return Ok(None);
|
||||
}
|
||||
}
|
||||
trace!("TCP creating new listening socket");
|
||||
@@ -181,7 +181,7 @@ impl<'a> SchemeSocket for TcpSocket<'a> {
|
||||
.expect("Can't listen on local endpoint");
|
||||
}
|
||||
port_set.acquire_port(local_endpoint.port);
|
||||
return Ok((new_handle, Some((new_socket_handle, ()))));
|
||||
return Ok(Some((new_handle, Some((new_socket_handle, ())))));
|
||||
} else {
|
||||
return Err(SyscallError::new(syscall::EBADF));
|
||||
},
|
||||
@@ -199,7 +199,7 @@ impl<'a> SchemeSocket for TcpSocket<'a> {
|
||||
port_set.acquire_port(local_endpoint.port);
|
||||
}
|
||||
|
||||
Ok((file, None))
|
||||
Ok(Some((file, None)))
|
||||
}
|
||||
|
||||
fn fpath(&self, _: &SchemeFile<Self>, buf: &mut [u8]) -> SyscallResult<usize> {
|
||||
|
||||
@@ -171,7 +171,7 @@ impl<'a, 'b> SchemeSocket for UdpSocket<'a, 'b> {
|
||||
port_set.acquire_port(endpoint.port);
|
||||
}
|
||||
|
||||
Ok((file, None))
|
||||
Ok(Some((file, None)))
|
||||
}
|
||||
|
||||
fn fpath(&self, file: &SchemeFile<Self>, buf: &mut [u8]) -> SyscallResult<usize> {
|
||||
|
||||
Reference in New Issue
Block a user