From bdd8126b938de11272f79bb7f512316740469ed7 Mon Sep 17 00:00:00 2001 From: Tomasz Kramkowski Date: Fri, 27 Jan 2023 14:22:33 +0000 Subject: use cap-std --- openat/tests/tmpfile.rs | 24 ------------------------ 1 file changed, 24 deletions(-) delete mode 100644 openat/tests/tmpfile.rs (limited to 'openat/tests') diff --git a/openat/tests/tmpfile.rs b/openat/tests/tmpfile.rs deleted file mode 100644 index 4fa0f0d..0000000 --- a/openat/tests/tmpfile.rs +++ /dev/null @@ -1,24 +0,0 @@ -extern crate tempfile; -extern crate openat; - -use std::io::{self, Read, Write}; -use std::os::unix::fs::PermissionsExt; -use openat::Dir; - -#[test] -#[cfg(target_os="linux")] -fn unnamed_tmp_file_link() -> Result<(), io::Error> { - let tmp = tempfile::tempdir()?; - let dir = Dir::open(tmp.path())?; - let mut f = dir.new_unnamed_file(0o777)?; - f.write(b"hello\n")?; - // In glibc <= 2.22 permissions aren't set when using O_TMPFILE - // This includes ubuntu trusty on travis CI - f.set_permissions(PermissionsExt::from_mode(0o644))?; - dir.link_file_at(&f, "hello.txt")?; - let mut f = dir.open_file("hello.txt")?; - let mut buf = String::with_capacity(10); - f.read_to_string(&mut buf)?; - assert_eq!(buf, "hello\n"); - Ok(()) -} -- cgit v1.2.3-54-g00ecf