autocommit 2022-02-24 16:30:11 CET
This commit is contained in:
parent
666e475032
commit
7d28d30666
39 changed files with 1670 additions and 209 deletions
|
|
@ -74,7 +74,11 @@ impl BufFdIn {
|
|||
name: uapi::sockaddr_none_mut(),
|
||||
flags: 0,
|
||||
};
|
||||
let (iov, _, mut cmsg) = match uapi::recvmsg(self.fd.raw(), &mut hdr, c::MSG_DONTWAIT) {
|
||||
let (iov, _, mut cmsg) = match uapi::recvmsg(
|
||||
self.fd.raw(),
|
||||
&mut hdr,
|
||||
c::MSG_DONTWAIT | c::MSG_CMSG_CLOEXEC,
|
||||
) {
|
||||
Ok((iov, _, _)) if iov.is_empty() => return Err(BufFdError::Closed),
|
||||
Ok(v) => v,
|
||||
Err(Errno(c::EAGAIN)) => return Ok(true),
|
||||
|
|
|
|||
|
|
@ -157,7 +157,11 @@ impl BufFdOut {
|
|||
Ok(false)
|
||||
}
|
||||
|
||||
pub async fn flush2(&mut self, buf: &[u8], fds: &mut Vec<Rc<OwnedFd>>) -> Result<(), BufFdError> {
|
||||
pub async fn flush2(
|
||||
&mut self,
|
||||
buf: &[u8],
|
||||
fds: &mut Vec<Rc<OwnedFd>>,
|
||||
) -> Result<(), BufFdError> {
|
||||
let mut read_pos = 0;
|
||||
while read_pos < buf.len() {
|
||||
if self.flush_sync2(&mut read_pos, buf, fds)? {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue