Skip to content

Commit 552bdf2

Browse files
Linux crash test: no longer sync the directory explicitly
This is now done automatically by atomic-write-file
1 parent 7da14cb commit 552bdf2

File tree

2 files changed

+0
-15
lines changed

2 files changed

+0
-15
lines changed

crash-tests/linux/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ edition = "2021"
77

88
[dependencies]
99
atomic-write-file = { path = "../.." }
10-
nix = "0.28.0"
1110

1211
[features]
1312
unnamed-tmpfile = ["atomic-write-file/unnamed-tmpfile"]

crash-tests/linux/src/main.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,8 @@
11
use atomic_write_file::AtomicWriteFile;
2-
use nix::unistd::close;
3-
use nix::unistd::fsync;
42
use std::io::Write;
5-
use std::os::fd::AsFd;
6-
use std::os::fd::AsRawFd;
73

84
fn main() {
95
let mut file = AtomicWriteFile::open("/test/file").expect("open failed");
10-
let dir = file
11-
.directory()
12-
.expect("could not obtain directory fd")
13-
.as_fd()
14-
.try_clone_to_owned()
15-
.expect("could not duplicate directory fd");
16-
176
file.write_all(b"hello").expect("write failed");
187
file.commit().expect("commit failed");
19-
20-
fsync(dir.as_raw_fd()).expect("directory sync failed");
21-
close(dir.as_raw_fd()).expect("closing directory failed");
228
}

0 commit comments

Comments
 (0)