diff options
author | Ossi Herrala <oherrala@iki.fi> | 2021-08-09 08:46:16 +0300 |
---|---|---|
committer | Ossi Herrala <oherrala@iki.fi> | 2021-08-09 08:46:16 +0300 |
commit | 6ec6d4021bb2613e24224220bfa171146384a344 (patch) | |
tree | 558b51898251a28b8f5986c0ceb6824d04749153 /src/cmd | |
parent | 0af848392da0471076f9a393fe09d4f808ef63a8 (diff) | |
download | obnam2-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')
-rw-r--r-- | src/cmd/restore.rs | 2 |
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)); |