aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/util.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-08-01 09:25:26 +0200
committermarha <marha@users.sourceforge.net>2011-08-01 09:25:26 +0200
commitd80ce197266a28cf85621d01a3d57606e40df87a (patch)
tree24b7f8608c946aa88415d91e0899556f2e80b3fe /tools/mhmake/src/util.cpp
parent6730a76afc49a80573b2e582085086c2956fe96d (diff)
downloadvcxsrv-d80ce197266a28cf85621d01a3d57606e40df87a.tar.gz
vcxsrv-d80ce197266a28cf85621d01a3d57606e40df87a.tar.bz2
vcxsrv-d80ce197266a28cf85621d01a3d57606e40df87a.zip
linux: make sure that newly created directories get the same permissions as
the parent directory.
Diffstat (limited to 'tools/mhmake/src/util.cpp')
-rw-r--r--tools/mhmake/src/util.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/mhmake/src/util.cpp b/tools/mhmake/src/util.cpp
index 20f85adbe..5864fc7de 100644
--- a/tools/mhmake/src/util.cpp
+++ b/tools/mhmake/src/util.cpp
@@ -765,7 +765,10 @@ bool MakeDirs(fileinfo *pDir)
}
if (!pDir->GetDate().DoesExist())
{ /* Create directory */
- if (-1==mkdir(pDir->GetFullFileName().c_str(),S_IRWXU))
+ struct stat statbuf;
+ if ( (-1==stat(pParentDir->GetFullFileName().c_str(),&statbuf)) ||
+ (-1==mkdir(pDir->GetFullFileName().c_str(),statbuf.st_mode))
+ )
{
cerr << "mkdir function failed for directory " << QuoteFileName(pDir->GetFullFileName()) << endl;
return false;