Skip to content

Commit ee2e1de

Browse files
committed
Use .bits() method rather than field for bitflags.
1 parent c6f9e23 commit ee2e1de

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

src/mount/bsd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ impl<'a> Nmount<'a> {
392392

393393
let niov = self.iov.len() as c_uint;
394394
let iovp = self.iov.as_mut_ptr() as *mut libc::iovec;
395-
let res = unsafe { libc::nmount(iovp, niov, flags.bits) };
395+
let res = unsafe { libc::nmount(iovp, niov, flags.bits()) };
396396
match Errno::result(res) {
397397
Ok(_) => Ok(()),
398398
Err(error) => {
@@ -446,7 +446,7 @@ where
446446
P: ?Sized + NixPath,
447447
{
448448
let res = mountpoint.with_nix_path(|cstr| unsafe {
449-
libc::unmount(cstr.as_ptr(), flags.bits)
449+
libc::unmount(cstr.as_ptr(), flags.bits())
450450
})?;
451451

452452
Errno::result(res).map(drop)

src/mount/linux.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ pub fn mount<
132132
s,
133133
t.as_ptr(),
134134
ty,
135-
flags.bits,
135+
flags.bits(),
136136
d as *const libc::c_void,
137137
)
138138
})
@@ -156,7 +156,7 @@ pub fn umount<P: ?Sized + NixPath>(target: &P) -> Result<()> {
156156
/// See also [`umount`](https://man7.org/linux/man-pages/man2/umount.2.html)
157157
pub fn umount2<P: ?Sized + NixPath>(target: &P, flags: MntFlags) -> Result<()> {
158158
let res = target.with_nix_path(|cstr| unsafe {
159-
libc::umount2(cstr.as_ptr(), flags.bits)
159+
libc::umount2(cstr.as_ptr(), flags.bits())
160160
})?;
161161

162162
Errno::result(res).map(drop)

src/mqueue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl MqAttr {
139139
/// Open a message queue
140140
///
141141
/// See also [`mq_open(2)`](https://pubs.opengroup.org/onlinepubs/9699919799/functions/mq_open.html)
142-
// The mode.bits cast is only lossless on some OSes
142+
// The mode.bits() cast is only lossless on some OSes
143143
#[allow(clippy::cast_lossless)]
144144
pub fn mq_open(
145145
name: &CStr,

src/sys/stat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ pub fn mknod<P: ?Sized + NixPath>(
177177
dev: dev_t,
178178
) -> Result<()> {
179179
let res = path.with_nix_path(|cstr| unsafe {
180-
libc::mknod(cstr.as_ptr(), kind.bits | perm.bits() as mode_t, dev)
180+
libc::mknod(cstr.as_ptr(), kind.bits() | perm.bits() as mode_t, dev)
181181
})?;
182182

183183
Errno::result(res).map(drop)
@@ -202,7 +202,7 @@ pub fn mknodat<P: ?Sized + NixPath>(
202202
libc::mknodat(
203203
dirfd,
204204
cstr.as_ptr(),
205-
kind.bits | perm.bits() as mode_t,
205+
kind.bits() | perm.bits() as mode_t,
206206
dev,
207207
)
208208
})?;

src/unistd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3375,7 +3375,7 @@ feature! {
33753375
/// See [access(2)](https://pubs.opengroup.org/onlinepubs/9699919799/functions/access.html)
33763376
pub fn access<P: ?Sized + NixPath>(path: &P, amode: AccessFlags) -> Result<()> {
33773377
let res = path.with_nix_path(|cstr| unsafe {
3378-
libc::access(cstr.as_ptr(), amode.bits)
3378+
libc::access(cstr.as_ptr(), amode.bits())
33793379
})?;
33803380
Errno::result(res).map(drop)
33813381
}
@@ -3422,7 +3422,7 @@ pub fn faccessat<P: ?Sized + NixPath>(
34223422
))]
34233423
pub fn eaccess<P: ?Sized + NixPath>(path: &P, mode: AccessFlags) -> Result<()> {
34243424
let res = path.with_nix_path(|cstr| unsafe {
3425-
libc::eaccess(cstr.as_ptr(), mode.bits)
3425+
libc::eaccess(cstr.as_ptr(), mode.bits())
34263426
})?;
34273427
Errno::result(res).map(drop)
34283428
}

0 commit comments

Comments
 (0)