aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tools/mhmake/src/build.cpp5
-rw-r--r--tools/mhmake/src/util.cpp5
-rw-r--r--tools/mhmake/src/util.h2
3 files changed, 9 insertions, 3 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;
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;
diff --git a/tools/mhmake/src/util.h b/tools/mhmake/src/util.h
index 694012cea..342ec8c8a 100644
--- a/tools/mhmake/src/util.h
+++ b/tools/mhmake/src/util.h
@@ -50,7 +50,7 @@
#define PLATFORM "linux"
#endif
-#define MHMAKEVER "3.0.4"
+#define MHMAKEVER "3.0.5"
class makecommand
{