summaryrefslogtreecommitdiff
path: root/src/cmd/restore.rs
diff options
context:
space:
mode:
authorOssi Herrala <oherrala@iki.fi>2021-08-09 08:46:16 +0300
committerOssi Herrala <oherrala@iki.fi>2021-08-09 08:46:16 +0300
commit6ec6d4021bb2613e24224220bfa171146384a344 (patch)
tree558b51898251a28b8f5986c0ceb6824d04749153 /src/cmd/restore.rs
parent0af848392da0471076f9a393fe09d4f808ef63a8 (diff)
downloadobnam2-6ec6d4021bb2613e24224220bfa171146384a344.tar.gz
Fix compilation on MacOS
For chmod() we need to cast mode parameter from u32 to u16 because MacOS has 16 bit mode_t while Linux is using 32 bits.
Diffstat (limited to 'src/cmd/restore.rs')
-rw-r--r--src/cmd/restore.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/restore.rs b/src/cmd/restore.rs
index e03f3de..e9e89b5 100644
--- a/src/cmd/restore.rs
+++ b/src/cmd/restore.rs
@@ -264,7 +264,7 @@ fn restore_metadata(path: &Path, entry: &FilesystemEntry) -> Result<(), RestoreE
unsafe {
if entry.kind() != FilesystemKind::Symlink {
debug!("chmod {:?}", path);
- if chmod(path.as_ptr(), entry.mode()) == -1 {
+ if chmod(path.as_ptr(), entry.mode() as libc::mode_t) == -1 {
let error = Error::last_os_error();
error!("chmod failed on {:?}", path);
return Err(RestoreError::Chmod(pathbuf, error));