pxar: improve error messages

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
Wolfgang Bumiller 2021-02-09 13:01:15 +01:00
parent ab6cd4229b
commit befd95a90a
2 changed files with 5 additions and 3 deletions

View File

@ -403,7 +403,8 @@ impl Extractor {
metadata,
file.as_raw_fd(),
&mut self.on_error,
)?;
)
.map_err(|err| format_err!("failed to apply initial flags: {}", err))?;
let extracted = io::copy(&mut *contents, &mut file)
.map_err(|err| format_err!("failed to copy file contents: {}", err))?;
@ -445,7 +446,8 @@ impl Extractor {
metadata,
file.as_raw_fd(),
&mut self.on_error,
)?;
)
.map_err(|err| format_err!("failed to apply initial flags: {}", err))?;
let extracted = tokio::io::copy(&mut *contents, &mut file)
.await

View File

@ -385,7 +385,7 @@ fn apply_flags(flags: Flags, fd: RawFd, entry_flags: u64) -> Result<(), Error> {
match unsafe { fs::write_fat_attr_fd(fd, &fatattr) } {
Ok(_) => (),
Err(nix::Error::Sys(errno)) if errno_is_unsupported(errno) => (),
Err(err) => bail!("failed to set file attributes: {}", err),
Err(err) => bail!("failed to set file FAT attributes: {}", err),
}
}