From 1f319e766e53e883b77fb40a87fc921035a233f1 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 6 Jun 2019 12:28:25 +0200 Subject: [PATCH] src/pxar/encoder.rs: refactoring: use ioctl calls from src/tools/fs.rs instead of local Signed-off-by: Christian Ebner --- src/pxar/encoder.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/pxar/encoder.rs b/src/pxar/encoder.rs index 0162eff3..c77acb6e 100644 --- a/src/pxar/encoder.rs +++ b/src/pxar/encoder.rs @@ -187,7 +187,7 @@ impl <'a, W: Write> Encoder<'a, W> { let mut attr: usize = 0; - let res = unsafe { read_attr_fd(fd, &mut attr)}; + let res = unsafe { fs::read_attr_fd(fd, &mut attr)}; if let Err(err) = res { if let nix::Error::Sys(errno) = err { if errno_is_unsupported(errno) { return Ok(()) }; @@ -207,7 +207,7 @@ impl <'a, W: Write> Encoder<'a, W> { let mut attr: u32 = 0; - let res = unsafe { read_fat_attr_fd(fd, &mut attr)}; + let res = unsafe { fs::read_fat_attr_fd(fd, &mut attr)}; if let Err(err) = res { if let nix::Error::Sys(errno) = err { if errno_is_unsupported(errno) { return Ok(()) }; @@ -933,16 +933,6 @@ fn detect_fs_type(fd: RawFd) -> Result { Ok(fs_stat.f_type) } -use nix::{convert_ioctl_res, request_code_read, ioc}; - -// /usr/include/linux/fs.h: #define FS_IOC_GETFLAGS _IOR('f', 1, long) -// read Linux file system attributes (see man chattr) -nix::ioctl_read!(read_attr_fd, b'f', 1, usize); - -// /usr/include/linux/msdos_fs.h: #define FAT_IOCTL_GET_ATTRIBUTES _IOR('r', 0x10, __u32) -// read FAT file system attributes -nix::ioctl_read!(read_fat_attr_fd, b'r', 0x10, u32); - // from /usr/include/linux/magic.h // and from casync util.h