From af50eeafab4ffbe4c2b6911c62d02251cb881c69 Mon Sep 17 00:00:00 2001 From: liushuyu Date: Sat, 3 Apr 2021 05:39:55 -0600 Subject: [PATCH] tests: display system error for the special files test --- tests/all.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tests/all.rs b/tests/all.rs index b43b24e4..228f28c9 100644 --- a/tests/all.rs +++ b/tests/all.rs @@ -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()));