diff options
Diffstat (limited to 'src/sys/socket/mod.rs')
-rw-r--r-- | src/sys/socket/mod.rs | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/sys/socket/mod.rs b/src/sys/socket/mod.rs index e333f005..cdb8b4b3 100644 --- a/src/sys/socket/mod.rs +++ b/src/sys/socket/mod.rs @@ -571,16 +571,16 @@ pub fn socket<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: SockType target_os = "netbsd", target_os = "openbsd"))] { - use fcntl::{fcntl, FD_CLOEXEC, O_NONBLOCK}; + use fcntl::{fcntl, FdFlag, OFlag}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; if !feat_atomic { - if flags.contains(SOCK_CLOEXEC) { - try!(fcntl(res, F_SETFD(FD_CLOEXEC))); + if flags.contains(SockFlag::SOCK_CLOEXEC) { + try!(fcntl(res, F_SETFD(FdFlag::FD_CLOEXEC))); } - if flags.contains(SOCK_NONBLOCK) { - try!(fcntl(res, F_SETFL(O_NONBLOCK))); + if flags.contains(SockFlag::SOCK_NONBLOCK) { + try!(fcntl(res, F_SETFL(OFlag::O_NONBLOCK))); } } } @@ -616,18 +616,18 @@ pub fn socketpair<T: Into<Option<SockProtocol>>>(domain: AddressFamily, ty: Sock target_os = "netbsd", target_os = "openbsd"))] { - use fcntl::{fcntl, FD_CLOEXEC, O_NONBLOCK}; + use fcntl::{fcntl, FdFlag, OFlag}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; if !feat_atomic { - if flags.contains(SOCK_CLOEXEC) { - try!(fcntl(fds[0], F_SETFD(FD_CLOEXEC))); - try!(fcntl(fds[1], F_SETFD(FD_CLOEXEC))); + if flags.contains(SockFlag::SOCK_CLOEXEC) { + try!(fcntl(fds[0], F_SETFD(FdFlag::FD_CLOEXEC))); + try!(fcntl(fds[1], F_SETFD(FdFlag::FD_CLOEXEC))); } - if flags.contains(SOCK_NONBLOCK) { - try!(fcntl(fds[0], F_SETFL(O_NONBLOCK))); - try!(fcntl(fds[1], F_SETFL(O_NONBLOCK))); + if flags.contains(SockFlag::SOCK_NONBLOCK) { + try!(fcntl(fds[0], F_SETFL(OFlag::O_NONBLOCK))); + try!(fcntl(fds[1], F_SETFL(OFlag::O_NONBLOCK))); } } } @@ -698,15 +698,15 @@ fn accept4_polyfill(sockfd: RawFd, flags: SockFlag) -> Result<RawFd> { target_os = "netbsd", target_os = "openbsd"))] { - use fcntl::{fcntl, FD_CLOEXEC, O_NONBLOCK}; + use fcntl::{fcntl, FdFlag, OFlag}; use fcntl::FcntlArg::{F_SETFD, F_SETFL}; - if flags.contains(SOCK_CLOEXEC) { - try!(fcntl(res, F_SETFD(FD_CLOEXEC))); + if flags.contains(SockFlag::SOCK_CLOEXEC) { + try!(fcntl(res, F_SETFD(FdFlag::FD_CLOEXEC))); } - if flags.contains(SOCK_NONBLOCK) { - try!(fcntl(res, F_SETFL(O_NONBLOCK))); + if flags.contains(SockFlag::SOCK_NONBLOCK) { + try!(fcntl(res, F_SETFL(OFlag::O_NONBLOCK))); } } |