diff --git a/tests/all.rs b/tests/all.rs index b43b24e4..a2ff4208 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -1157,27 +1157,27 @@ fn tar_directory_containing_special_files() { use std::ffi::CString; let td = t!(TempBuilder::new().prefix("tar-rs").tempdir()); - let cdev = td.path().join("chr"); let fifo = td.path().join("fifo"); unsafe { - let cdev_path = t!(CString::new(cdev.to_str().unwrap())); - let ret = libc::mknod(cdev_path.as_ptr(), libc::S_IFCHR | 0o644, 0); - assert_eq!(ret, 0); let fifo_path = t!(CString::new(fifo.to_str().unwrap())); let ret = libc::mknod(fifo_path.as_ptr(), libc::S_IFIFO | 0o644, 0); - assert_eq!(ret, 0); + if ret != 0 { + libc::perror(fifo_path.as_ptr()); + panic!("Failed to create a FIFO file"); + } } t!(env::set_current_dir(td.path())); let mut ar = Builder::new(Vec::new()); // append_path has a different logic for processing files, so we need to test it as well - t!(ar.append_path("chr")); t!(ar.append_path("fifo")); t!(ar.append_dir_all("special", td.path())); // unfortunately, block device file cannot be created by non-root users // as a substitute, just test the file that exists on most Unix systems t!(env::set_current_dir("/dev/")); t!(ar.append_path("loop0")); + // CI systems seem to have issues with creating a chr device + t!(ar.append_path("null")); t!(ar.finish()); }