diff options
author | marha <marha@users.sourceforge.net> | 2011-08-01 09:25:26 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-08-01 09:25:26 +0200 |
commit | d80ce197266a28cf85621d01a3d57606e40df87a (patch) | |
tree | 24b7f8608c946aa88415d91e0899556f2e80b3fe /tools/mhmake/src/build.cpp | |
parent | 6730a76afc49a80573b2e582085086c2956fe96d (diff) | |
download | vcxsrv-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/build.cpp')
-rw-r--r-- | tools/mhmake/src/build.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/mhmake/src/build.cpp b/tools/mhmake/src/build.cpp index f8f341753..ee79ad4f6 100644 --- a/tools/mhmake/src/build.cpp +++ b/tools/mhmake/src/build.cpp @@ -357,7 +357,10 @@ exit: Error = false;
goto exit;
}
- if (-1==mkdir(pNewDest->GetFullFileName().c_str(),S_IRWXU))
+ struct stat statbuf;
+ if ( (-1==stat(pDest->GetFullFileName().c_str(),&statbuf)) ||
+ (-1==mkdir(pNewDest->GetFullFileName().c_str(),statbuf.st_mode))
+ )
{
cerr << "Error creating directory " << pNewDest->GetQuotedFullFileName() << endl;
Error = false;
|