Skip to content

Commit 158836f

Browse files
authored
Merge pull request #64 from coreos/dependabot/cargo/rustix-1.0
build(deps): update rustix requirement from 0.38 to 1.0
2 parents 387eb19 + 2737d7d commit 158836f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ cap-tempfile = "3.2.0"
1515
cap-primitives = "3"
1616

1717
[target.'cfg(not(windows))'.dependencies]
18-
rustix = { version = "0.38", features = ["fs", "procfs", "process", "pipe"] }
18+
rustix = { version = "1.0", features = ["fs", "process", "pipe"] }
1919
libc = "0.2"
2020

2121
[dev-dependencies]

src/dirext.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -351,20 +351,20 @@ fn openat2_with_retry(
351351

352352
fn is_mountpoint_impl_statx(root: &Dir, path: &Path) -> Result<Option<bool>> {
353353
// https://github.com/systemd/systemd/blob/8fbf0a214e2fe474655b17a4b663122943b55db0/src/basic/mountpoint-util.c#L176
354+
use rustix::fs::StatxAttributes;
354355
use rustix::fs::{AtFlags, StatxFlags};
355356
use std::os::fd::AsFd;
356357

357358
// SAFETY(unwrap): We can infallibly convert an i32 into a u64.
358-
let mountroot_flag: u64 = libc::STATX_ATTR_MOUNT_ROOT.try_into().unwrap();
359359
match rustix::fs::statx(
360360
root.as_fd(),
361361
path,
362362
AtFlags::NO_AUTOMOUNT | AtFlags::SYMLINK_NOFOLLOW,
363363
StatxFlags::empty(),
364364
) {
365365
Ok(r) => {
366-
let present = (r.stx_attributes_mask & mountroot_flag) > 0;
367-
Ok(present.then_some(r.stx_attributes & mountroot_flag > 0))
366+
let present = r.stx_attributes_mask.contains(StatxAttributes::MOUNT_ROOT);
367+
Ok(present.then_some(r.stx_attributes.contains(StatxAttributes::MOUNT_ROOT)))
368368
}
369369
Err(e) if e == rustix::io::Errno::NOSYS => Ok(None),
370370
Err(e) => Err(e.into()),

0 commit comments

Comments
 (0)