From 3a905cac2b4c613f7465213d4b0f914a2abcef52 Mon Sep 17 00:00:00 2001 From: Christian Ebner Date: Thu, 1 Aug 2019 16:23:49 +0200 Subject: [PATCH] src/pxar/sequential_decoder.rs: remove of obsolete function dir_mkdirat Signed-off-by: Christian Ebner --- src/pxar/sequential_decoder.rs | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/src/pxar/sequential_decoder.rs b/src/pxar/sequential_decoder.rs index 45218184..65288cc2 100644 --- a/src/pxar/sequential_decoder.rs +++ b/src/pxar/sequential_decoder.rs @@ -1073,29 +1073,6 @@ fn file_openat(parent: RawFd, filename: &OsStr, flags: OFlag, mode: Mode) -> Res Ok(file) } -fn dir_mkdirat(parent: RawFd, filename: &OsStr, create_new: bool) -> Result { - - // call mkdirat first - let res = filename.with_nix_path(|cstr| unsafe { - libc::mkdirat(parent, cstr.as_ptr(), libc::S_IRWXU) - })?; - - match Errno::result(res) { - Ok(_) => {}, - Err(err) => { - if err == nix::Error::Sys(nix::errno::Errno::EEXIST) { - if create_new { return Err(err); } - } else { - return Err(err); - } - } - } - - let dir = nix::dir::Dir::openat(parent, filename, OFlag::O_DIRECTORY, Mode::empty())?; - - Ok(dir) -} - fn hardlink(oldpath: &Path, newpath: &Path) -> Result<(), Error> { oldpath.with_nix_path(|oldpath| { newpath.with_nix_path(|newpath| {