summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2021-10-09 17:13:14 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2021-10-09 17:14:37 +0200
commitac670ae29e997fbc46cc773a6dd9f92ecc71c2fc (patch)
tree6f55ded3de4d7cc4152d1ba0040af8b49e9241e5 /src
parent7d97e7340f44182996b924e285893aa3752cbb9e (diff)
downloadrebel-ac670ae29e997fbc46cc773a6dd9f92ecc71c2fc.tar
rebel-ac670ae29e997fbc46cc773a6dd9f92ecc71c2fc.zip
runc: fix error handling when moving layer directory
Diffstat (limited to 'src')
-rw-r--r--src/runner/runc/run.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/runner/runc/run.rs b/src/runner/runc/run.rs
index dce239c..4227540 100644
--- a/src/runner/runc/run.rs
+++ b/src/runner/runc/run.rs
@@ -1,6 +1,6 @@
use std::{
collections::HashMap,
- io::{self, BufWriter},
+ io::BufWriter,
path::{Path, PathBuf},
process,
};
@@ -266,7 +266,10 @@ fn move_layer(task: &runner::Task, hash: &LayerHash) -> Result<()> {
Err(err) => err,
};
- if err.kind() != io::ErrorKind::AlreadyExists {
+ if !matches!(
+ err.raw_os_error(),
+ Some(libc::EEXIST) | Some(libc::ENOTEMPTY)
+ ) {
return Err(err)
.with_context(|| format!("Failed to rename {:?} to {:?}", task_layer_dir, layer_dir));
}