Skip to content

Commit

Permalink
Bump bitflags to 0.7
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Feb 14, 2017
1 parent 7a91a81 commit c1af8b4
Show file tree
Hide file tree
Showing 21 changed files with 52 additions and 55 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ signalfd = []

[dependencies]
libc = { git = "https://github.com/rust-lang/libc" }
bitflags = "0.4"
bitflags = "0.7"
cfg-if = "0.1.0"
void = "1.0.2"

Expand Down
24 changes: 12 additions & 12 deletions src/fcntl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ mod consts {
use libc::{self, c_int, c_uint};

bitflags! {
flags SpliceFFlags: c_uint {
pub flags SpliceFFlags: c_uint {
const SPLICE_F_MOVE = libc::SPLICE_F_MOVE,
const SPLICE_F_NONBLOCK = libc::SPLICE_F_NONBLOCK,
const SPLICE_F_MORE = libc::SPLICE_F_MORE,
Expand All @@ -147,7 +147,7 @@ mod consts {
}

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0o00000003,
const O_RDONLY = 0o00000000,
const O_WRONLY = 0o00000001,
Expand All @@ -173,13 +173,13 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);

bitflags!(
flags SealFlag: c_int {
pub flags SealFlag: c_int {
const F_SEAL_SEAL = 1,
const F_SEAL_SHRINK = 2,
const F_SEAL_GROW = 4,
Expand All @@ -194,7 +194,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -216,7 +216,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -227,7 +227,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -253,7 +253,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -264,7 +264,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand Down Expand Up @@ -294,7 +294,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand All @@ -305,7 +305,7 @@ mod consts {
use libc::c_int;

bitflags!(
flags OFlag: c_int {
pub flags OFlag: c_int {
const O_ACCMODE = 0x0000003,
const O_RDONLY = 0x0000000,
const O_WRONLY = 0x0000001,
Expand All @@ -329,7 +329,7 @@ mod consts {
);

bitflags!(
flags FdFlag: c_int {
pub flags FdFlag: c_int {
const FD_CLOEXEC = 1
}
);
Expand Down
3 changes: 0 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#![crate_name = "nix"]
#![cfg(unix)]
#![allow(non_camel_case_types)]
// latest bitflags triggers a rustc bug with cross-crate macro expansions causing dead_code
// warnings even though the macro expands into something with allow(dead_code)
#![allow(dead_code)]
#![cfg_attr(test, deny(warnings))]

#[macro_use]
Expand Down
4 changes: 2 additions & 2 deletions src/mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use libc;
use {Errno, Result, NixPath};

bitflags!(
flags MsFlags: c_ulong {
pub flags MsFlags: c_ulong {
const MS_RDONLY = 1 << 0, // Mount read-only
const MS_NOSUID = 1 << 1, // Ignore suid and sgid bits
const MS_NODEV = 1 << 2, // Disallow access to device special files
Expand Down Expand Up @@ -42,7 +42,7 @@ bitflags!(
);

bitflags!(
flags MntFlags: c_int {
pub flags MntFlags: c_int {
const MNT_FORCE = 1 << 0,
const MNT_DETACH = 1 << 1,
const MNT_EXPIRE = 1 << 2
Expand Down
4 changes: 2 additions & 2 deletions src/mqueue.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use sys::stat::Mode;
use std::mem;

libc_bitflags!{
flags MQ_OFlag: libc::c_int {
pub flags MQ_OFlag: libc::c_int {
O_RDONLY,
O_WRONLY,
O_RDWR,
Expand All @@ -22,7 +22,7 @@ libc_bitflags!{
}

libc_bitflags!{
flags FdFlag: libc::c_int {
pub flags FdFlag: libc::c_int {
FD_CLOEXEC,
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ impl PollFd {
}

libc_bitflags! {
flags EventFlags: libc::c_short {
pub flags EventFlags: libc::c_short {
POLLIN,
POLLPRI,
POLLOUT,
Expand Down
2 changes: 1 addition & 1 deletion src/sched.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use {Errno, Error, Result};
// For some functions taking with a parameter of type CloneFlags,
// only a subset of these flags have an effect.
libc_bitflags!{
flags CloneFlags: libc::c_int {
pub flags CloneFlags: libc::c_int {
CLONE_VM,
CLONE_FS,
CLONE_FILES,
Expand Down
4 changes: 2 additions & 2 deletions src/sys/epoll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use ::Error;

bitflags!(
#[repr(C)]
flags EpollFlags: u32 {
pub flags EpollFlags: u32 {
const EPOLLIN = 0x001,
const EPOLLPRI = 0x002,
const EPOLLOUT = 0x004,
Expand Down Expand Up @@ -35,7 +35,7 @@ pub enum EpollOp {
}

libc_bitflags!{
flags EpollCreateFlags: c_int {
pub flags EpollCreateFlags: c_int {
EPOLL_CLOEXEC,
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/sys/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ pub type type_of_event_flag = u16;
#[cfg(any(target_os = "netbsd", target_os = "openbsd"))]
pub type type_of_event_flag = u32;
libc_bitflags!{
flags EventFlag: type_of_event_flag {
pub flags EventFlag: type_of_event_flag {
EV_ADD,
EV_CLEAR,
EV_DELETE,
Expand Down Expand Up @@ -106,7 +106,7 @@ libc_bitflags!{
}

bitflags!(
flags FilterFlag: u32 {
pub flags FilterFlag: u32 {
#[cfg(any(target_os = "macos", target_os = "ios"))]
const NOTE_ABSOLUTE = libc::NOTE_ABSOLUTE,
const NOTE_ATTRIB = libc::NOTE_ATTRIB,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/eventfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::os::unix::io::RawFd;
use {Errno, Result};

libc_bitflags! {
flags EfdFlags: libc::c_int {
pub flags EfdFlags: libc::c_int {
EFD_CLOEXEC, // Since Linux 2.6.27
EFD_NONBLOCK, // Since Linux 2.6.27
EFD_SEMAPHORE, // Since Linux 2.6.30
Expand Down
2 changes: 1 addition & 1 deletion src/sys/memfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use {Errno, Result};
use std::ffi::CStr;

bitflags!(
flags MemFdCreateFlag: libc::c_uint {
pub flags MemFdCreateFlag: libc::c_uint {
const MFD_CLOEXEC = 0x0001,
const MFD_ALLOW_SEALING = 0x0002,
}
Expand Down
14 changes: 7 additions & 7 deletions src/sys/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::os::unix::io::RawFd;
pub use self::consts::*;

libc_bitflags!{
flags ProtFlags: libc::c_int {
pub flags ProtFlags: libc::c_int {
PROT_NONE,
PROT_READ,
PROT_WRITE,
Expand All @@ -24,7 +24,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand Down Expand Up @@ -65,7 +65,7 @@ mod consts {


bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC,
const MS_INVALIDATE = libc::MS_INVALIDATE,
const MS_SYNC = libc::MS_SYNC,
Expand All @@ -81,7 +81,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand All @@ -106,7 +106,7 @@ mod consts {
pub const MADV_CAN_REUSE : MmapAdvise = 9;

bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
const MS_KILLPAGES = libc::MS_KILLPAGES, /* invalidate pages, leave mapped */
Expand All @@ -123,7 +123,7 @@ mod consts {
use libc::{self, c_int};

bitflags!{
flags MapFlags: c_int {
pub flags MapFlags: c_int {
const MAP_FILE = libc::MAP_FILE,
const MAP_SHARED = libc::MAP_SHARED,
const MAP_PRIVATE = libc::MAP_PRIVATE,
Expand Down Expand Up @@ -161,7 +161,7 @@ mod consts {
pub const MADV_SETMAP : MmapAdvise = 11; /* set page table directory page for map */

bitflags!{
flags MsFlags: c_int {
pub flags MsFlags: c_int {
const MS_ASYNC = libc::MS_ASYNC, /* [MF|SIO] return immediately */
const MS_INVALIDATE = libc::MS_INVALIDATE, /* [MF|SIO] invalidate all cached data */
#[cfg(not(target_os = "dragonfly"))]
Expand Down
2 changes: 1 addition & 1 deletion src/sys/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub mod quota {

bitflags!(
#[derive(Default)]
flags QuotaValidFlags: u32 {
pub flags QuotaValidFlags: u32 {
const QIF_BLIMITS = 1,
const QIF_SPACE = 2,
const QIF_ILIMITS = 4,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/signal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ pub const SIGPOLL : Signal = SIGIO;
pub const SIGUNUSED : Signal = SIGSYS;

bitflags!{
flags SaFlags: libc::c_int {
pub flags SaFlags: libc::c_int {
const SA_NOCLDSTOP = libc::SA_NOCLDSTOP,
const SA_NOCLDWAIT = libc::SA_NOCLDWAIT,
const SA_NODEFER = libc::SA_NODEFER,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/signalfd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use std::mem;


bitflags!{
flags SfdFlags: libc::c_int {
pub flags SfdFlags: libc::c_int {
const SFD_NONBLOCK = libc::SFD_NONBLOCK,
const SFD_CLOEXEC = libc::SFD_CLOEXEC,
}
Expand Down
6 changes: 3 additions & 3 deletions src/sys/socket/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x0001,
const MSG_PEEK = 0x0002,
const MSG_CTRUNC = 0x0008,
Expand Down Expand Up @@ -232,7 +232,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_EOR = 0x08,
Expand Down Expand Up @@ -318,7 +318,7 @@ mod os {

// Flags for send/recv and their relatives
bitflags!{
flags MsgFlags : libc::c_int {
pub flags MsgFlags : libc::c_int {
const MSG_OOB = 0x01,
const MSG_PEEK = 0x02,
const MSG_DONTWAIT = 0x80,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/socket/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ pub enum SockType {

// Extra flags - Supported by Linux 2.6.27, normalized on other platforms
bitflags!(
flags SockFlag: c_int {
pub flags SockFlag: c_int {
const SOCK_NONBLOCK = 0o0004000,
const SOCK_CLOEXEC = 0o2000000
}
Expand Down
4 changes: 2 additions & 2 deletions src/sys/stat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ mod ffi {
}

bitflags!(
flags SFlag: mode_t {
pub flags SFlag: mode_t {
const S_IFIFO = libc::S_IFIFO,
const S_IFCHR = libc::S_IFCHR,
const S_IFDIR = libc::S_IFDIR,
Expand All @@ -30,7 +30,7 @@ bitflags!(
);

bitflags! {
flags Mode: mode_t {
pub flags Mode: mode_t {
const S_IRWXU = libc::S_IRWXU,
const S_IRUSR = libc::S_IRUSR,
const S_IWUSR = libc::S_IWUSR,
Expand Down
2 changes: 1 addition & 1 deletion src/sys/statvfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ pub mod vfs {
/// Mount Flags
#[repr(C)]
#[derive(Default)]
flags FsFlags: c_ulong {
pub flags FsFlags: c_ulong {
/// Read Only
const RDONLY = 1,
/// Do not allow the set-uid bits to have an effect
Expand Down
Loading

0 comments on commit c1af8b4

Please sign in to comment.