summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Walbran <qwandor@google.com>2023-04-26 12:13:29 +0100
committerAndrew Walbran <qwandor@google.com>2023-05-22 10:40:29 +0100
commitee2e1deff805692c4a4cc9172b458b8a5edca44f (patch)
treec458819deafce46b0aea6298220dcee2ff7425df
parentc6f9e2332efcf62c751d7a0174bb791e732b90a8 (diff)
downloadnix-ee2e1deff805692c4a4cc9172b458b8a5edca44f.zip
Use .bits() method rather than field for bitflags.
-rw-r--r--src/mount/bsd.rs4
-rw-r--r--src/mount/linux.rs4
-rw-r--r--src/mqueue.rs2
-rw-r--r--src/sys/stat.rs4
-rw-r--r--src/unistd.rs4
5 files changed, 9 insertions, 9 deletions
diff --git a/src/mount/bsd.rs b/src/mount/bsd.rs
index d124f1f9..dbff6541 100644
--- a/src/mount/bsd.rs
+++ b/src/mount/bsd.rs
@@ -392,7 +392,7 @@ impl<'a> Nmount<'a> {
let niov = self.iov.len() as c_uint;
let iovp = self.iov.as_mut_ptr() as *mut libc::iovec;
- let res = unsafe { libc::nmount(iovp, niov, flags.bits) };
+ let res = unsafe { libc::nmount(iovp, niov, flags.bits()) };
match Errno::result(res) {
Ok(_) => Ok(()),
Err(error) => {
@@ -446,7 +446,7 @@ where
P: ?Sized + NixPath,
{
let res = mountpoint.with_nix_path(|cstr| unsafe {
- libc::unmount(cstr.as_ptr(), flags.bits)
+ libc::unmount(cstr.as_ptr(), flags.bits())
})?;
Errno::result(res).map(drop)
diff --git a/src/mount/linux.rs b/src/mount/linux.rs
index 5f19a5f1..e9876037 100644
--- a/src/mount/linux.rs
+++ b/src/mount/linux.rs
@@ -132,7 +132,7 @@ pub fn mount<
s,
t.as_ptr(),
ty,
- flags.bits,
+ flags.bits(),
d as *const libc::c_void,
)
})
@@ -156,7 +156,7 @@ pub fn umount<P: ?Sized + NixPath>(target: &P) -> Result<()> {
/// See also [`umount`](https://man7.org/linux/man-pages/man2/umount.2.html)
pub fn umount2<P: ?Sized + NixPath>(target: &P, flags: MntFlags) -> Result<()> {
let res = target.with_nix_path(|cstr| unsafe {
- libc::umount2(cstr.as_ptr(), flags.bits)
+ libc::umount2(cstr.as_ptr(), flags.bits())
})?;
Errno::result(res).map(drop)
diff --git a/src/mqueue.rs b/src/mqueue.rs
index ac183eb5..7ce7d5e8 100644
--- a/src/mqueue.rs
+++ b/src/mqueue.rs
@@ -139,7 +139,7 @@ impl MqAttr {
/// Open a message queue
///
/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html)
-// The mode.bits cast is only lossless on some OSes
+// The mode.bits() cast is only lossless on some OSes
#[allow(clippy::cast_lossless)]
pub fn mq_open(
name: &CStr,
diff --git a/src/sys/stat.rs b/src/sys/stat.rs
index 78203bfb..7e51c03a 100644
--- a/src/sys/stat.rs
+++ b/src/sys/stat.rs
@@ -177,7 +177,7 @@ pub fn mknod<P: ?Sized + NixPath>(
dev: dev_t,
) -> Result<()> {
let res = path.with_nix_path(|cstr| unsafe {
- libc::mknod(cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev)
+ libc::mknod(cstr.as_ptr(), kind.bits() | perm.bits() as mode_t, dev)
})?;
Errno::result(res).map(drop)
@@ -202,7 +202,7 @@ pub fn mknodat<P: ?Sized + NixPath>(
libc::mknodat(
dirfd,
cstr.as_ptr(),
- kind.bits | perm.bits() as mode_t,
+ kind.bits() | perm.bits() as mode_t,
dev,
)
})?;
diff --git a/src/unistd.rs b/src/unistd.rs
index 7230c337..afa80e9b 100644
--- a/src/unistd.rs
+++ b/src/unistd.rs
@@ -3375,7 +3375,7 @@ feature! {
/// See [access(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
pub fn access<P: ?Sized + NixPath>(path: &P, amode: AccessFlags) -> Result<()> {
let res = path.with_nix_path(|cstr| unsafe {
- libc::access(cstr.as_ptr(), amode.bits)
+ libc::access(cstr.as_ptr(), amode.bits())
})?;
Errno::result(res).map(drop)
}
@@ -3422,7 +3422,7 @@ pub fn faccessat<P: ?Sized + NixPath>(
))]
pub fn eaccess<P: ?Sized + NixPath>(path: &P, mode: AccessFlags) -> Result<()> {
let res = path.with_nix_path(|cstr| unsafe {
- libc::eaccess(cstr.as_ptr(), mode.bits)
+ libc::eaccess(cstr.as_ptr(), mode.bits())
})?;
Errno::result(res).map(drop)
}