From 373b2e483d983136415190dcc838e636077e5991 Mon Sep 17 00:00:00 2001 From: Daniel Pfeifer Date: Wed, 17 Aug 2016 23:52:34 +0200 Subject: cmArchiveWrite: replace mode_t with int Rationale: * mode_t is not defined on all platforms * bitmasking (operator &) promotes the value to an int anyway * libarchive uses int in the public api starting with version 4 --- Source/cmArchiveWrite.cxx | 2 +- Source/cmArchiveWrite.h | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/cmArchiveWrite.cxx b/Source/cmArchiveWrite.cxx index 3da4f28..56da2ac 100644 --- a/Source/cmArchiveWrite.cxx +++ b/Source/cmArchiveWrite.cxx @@ -268,7 +268,7 @@ bool cmArchiveWrite::AddFile(const char* file, size_t skip, const char* prefix) } if (this->PermissionsMask.IsSet()) { - mode_t perm = archive_entry_perm(e); + int perm = archive_entry_perm(e); archive_entry_set_perm(e, perm & this->PermissionsMask.Get()); } diff --git a/Source/cmArchiveWrite.h b/Source/cmArchiveWrite.h index f847d09..b15c15a 100644 --- a/Source/cmArchiveWrite.h +++ b/Source/cmArchiveWrite.h @@ -94,7 +94,7 @@ public: void SetMTime(std::string const& t) { this->MTime = t; } //! Sets the permissions of the added files/folders - void SetPermissions(mode_t permissions_) + void SetPermissions(int permissions_) { this->Permissions.Set(permissions_); } @@ -107,7 +107,7 @@ public: //! The permissions will be copied from the existing file //! or folder. The mask will then be applied to unset //! some of them - void SetPermissionsMask(mode_t permissionsMask_) + void SetPermissionsMask(int permissionsMask_) { this->PermissionsMask.Set(permissionsMask_); } @@ -177,8 +177,8 @@ private: //!@} //! Permissions on files/folders - cmArchiveWriteOptional Permissions; - cmArchiveWriteOptional PermissionsMask; + cmArchiveWriteOptional Permissions; + cmArchiveWriteOptional PermissionsMask; }; #endif -- cgit v0.12