From 867a530724f8180fd4e6b83ee5643d82608ece52 Mon Sep 17 00:00:00 2001 From: Wolfgang Bumiller Date: Wed, 18 Dec 2019 13:37:10 +0100 Subject: [PATCH] tools: create_dir: pass EEXIST to the caller Signed-off-by: Wolfgang Bumiller --- proxmox-tools/src/fs.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/proxmox-tools/src/fs.rs b/proxmox-tools/src/fs.rs index 9404e249..cb6b30d3 100644 --- a/proxmox-tools/src/fs.rs +++ b/proxmox-tools/src/fs.rs @@ -217,7 +217,7 @@ impl CreateOptions { /// Creates directory at the provided path with specified ownership. /// -/// Simply returns if the directory already exists. +/// Errors if the directory already exists. pub fn create_dir>(path: P, options: CreateOptions) -> Result<(), nix::Error> { // clippy bug?: from_bits_truncate is actually a const fn... #[allow(clippy::or_fun_call)] @@ -229,9 +229,6 @@ pub fn create_dir>(path: P, options: CreateOptions) -> Result<(), match nix::unistd::mkdir(path, mode) { Ok(()) => {} - Err(nix::Error::Sys(Errno::EEXIST)) => { - return Ok(()); - } err => return err, }