Skip to content

Commit

Permalink
tests: display system error for the special files test
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu committed Apr 3, 2021
1 parent 1b8556d commit af50eea
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions tests/all.rs
Expand Up @@ -1163,10 +1163,14 @@ fn tar_directory_containing_special_files() {
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);
if ret != 0 {
libc::perror(cdev_path.as_ptr());
}
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());
}
}

t!(env::set_current_dir(td.path()));
Expand Down

0 comments on commit af50eea

Please sign in to comment.