summaryrefslogtreecommitdiff
path: root/test/test_fcntl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test/test_fcntl.rs')
-rw-r--r--test/test_fcntl.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs
index 7651c909..18b73481 100644
--- a/test/test_fcntl.rs
+++ b/test/test_fcntl.rs
@@ -1,6 +1,4 @@
#[cfg(not(target_os = "redox"))]
-use nix::Error;
-#[cfg(not(target_os = "redox"))]
use nix::errno::*;
#[cfg(not(target_os = "redox"))]
use nix::fcntl::{open, OFlag, readlink};
@@ -55,7 +53,7 @@ fn test_renameat() {
let new_dirfd = open(new_dir.path(), OFlag::empty(), Mode::empty()).unwrap();
renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap();
assert_eq!(renameat(Some(old_dirfd), "old", Some(new_dirfd), "new").unwrap_err(),
- Error(Errno::ENOENT));
+ Errno::ENOENT);
close(old_dirfd).unwrap();
close(new_dirfd).unwrap();
assert!(new_dir.path().join("new").exists());
@@ -385,7 +383,7 @@ mod test_posix_fallocate {
assert_eq!(tmp.read(&mut data).expect("read failure"), LEN);
assert_eq!(&data[..], &[0u8; LEN][..]);
}
- Err(nix::Error(Errno::EINVAL)) => {
+ Err(Errno::EINVAL) => {
// POSIX requires posix_fallocate to return EINVAL both for
// invalid arguments (i.e. len < 0) and if the operation is not
// supported by the file system.
@@ -401,7 +399,7 @@ mod test_posix_fallocate {
fn errno() {
let (rd, _wr) = pipe().unwrap();
let err = posix_fallocate(rd as RawFd, 0, 100).unwrap_err();
- match err.0 {
+ match err {
Errno::EINVAL | Errno::ENODEV | Errno::ESPIPE | Errno::EBADF => (),
errno =>
panic!(