diff --git a/src/pxar/metadata.rs b/src/pxar/metadata.rs index 12a89cbe..8d24d85f 100644 --- a/src/pxar/metadata.rs +++ b/src/pxar/metadata.rs @@ -133,10 +133,6 @@ pub fn apply( .or_else(&mut *on_error)?; } - if metadata.stat.flags != 0 { - apply_flags(flags, fd, metadata.stat.flags).or_else(&mut *on_error)?; - } - let res = c_result!(unsafe { libc::utimensat( libc::AT_FDCWD, @@ -157,6 +153,10 @@ pub fn apply( } } + if metadata.stat.flags != 0 { + apply_flags(flags, fd, metadata.stat.flags).or_else(&mut *on_error)?; + } + Ok(()) }