summaryrefslogtreecommitdiffstats
path: root/Source/cmMakefile.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmMakefile.cxx')
-rw-r--r--Source/cmMakefile.cxx20
1 files changed, 5 insertions, 15 deletions
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 6d1868c..56b7ae1 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -29,15 +29,12 @@
#include "cmsys/FStream.hxx"
#include "cmsys/RegularExpression.hxx"
-#include "cm_sys_stat.h"
-
#include "cmCommandArgumentParserHelper.h"
#include "cmCustomCommand.h"
#include "cmCustomCommandLines.h"
#include "cmExecutionStatus.h"
#include "cmExpandedCommandArgument.h" // IWYU pragma: keep
#include "cmExportBuildFileGenerator.h"
-#include "cmFSPermissions.h"
#include "cmFileLockPool.h"
#include "cmFunctionBlocker.h"
#include "cmGeneratedFileStream.h"
@@ -72,8 +69,6 @@
class cmMessenger;
-using namespace cmFSPermissions;
-
cmDirectoryId::cmDirectoryId(std::string s)
: String(std::move(s))
{
@@ -3850,8 +3845,7 @@ void cmMakefile::ConfigureString(const std::string& input, std::string& output,
int cmMakefile::ConfigureFile(const std::string& infile,
const std::string& outfile, bool copyonly,
bool atOnly, bool escapeQuotes,
- bool use_source_permissions,
- cmNewLineStyle newLine)
+ mode_t permissions, cmNewLineStyle newLine)
{
int res = 1;
if (!this->CanIWriteThisFile(outfile)) {
@@ -3873,12 +3867,8 @@ int cmMakefile::ConfigureFile(const std::string& infile,
// output files that now don't exist.
this->AddCMakeOutputFile(soutfile);
- mode_t perm = 0;
- if (!use_source_permissions) {
- perm = perm | mode_owner_read | mode_owner_write | mode_group_read |
- mode_world_read;
- } else {
- cmSystemTools::GetPermissions(sinfile, perm);
+ if (permissions == 0) {
+ cmSystemTools::GetPermissions(sinfile, permissions);
}
std::string::size_type pos = soutfile.rfind('/');
@@ -3893,7 +3883,7 @@ int cmMakefile::ConfigureFile(const std::string& infile,
cmSystemTools::GetLastSystemError());
return 0;
}
- if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ if (!cmSystemTools::SetPermissions(soutfile, permissions)) {
this->IssueMessage(MessageType::FATAL_ERROR,
cmSystemTools::GetLastSystemError());
return 0;
@@ -3950,7 +3940,7 @@ int cmMakefile::ConfigureFile(const std::string& infile,
cmSystemTools::GetLastSystemError());
res = 0;
} else {
- if (!cmSystemTools::SetPermissions(soutfile, perm)) {
+ if (!cmSystemTools::SetPermissions(soutfile, permissions)) {
this->IssueMessage(MessageType::FATAL_ERROR,
cmSystemTools::GetLastSystemError());
res = 0;