aboutsummaryrefslogtreecommitdiff
path: root/tools/mhmake/src/mhmakefileparser.cpp
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-01-27 13:44:12 +0000
committermarha <marha@users.sourceforge.net>2011-01-27 13:44:12 +0000
commit11903063211dc368d03f52e090e52ab18ebe3f47 (patch)
tree71991c8ffd98ed31690190b37f39cfc6244b6595 /tools/mhmake/src/mhmakefileparser.cpp
parent59e0042680b01d7e3cf69104921f151ceee13df4 (diff)
downloadvcxsrv-11903063211dc368d03f52e090e52ab18ebe3f47.tar.gz
vcxsrv-11903063211dc368d03f52e090e52ab18ebe3f47.tar.bz2
vcxsrv-11903063211dc368d03f52e090e52ab18ebe3f47.zip
Implemented mkdir as an internal command
Diffstat (limited to 'tools/mhmake/src/mhmakefileparser.cpp')
-rw-r--r--tools/mhmake/src/mhmakefileparser.cpp22
1 files changed, 8 insertions, 14 deletions
diff --git a/tools/mhmake/src/mhmakefileparser.cpp b/tools/mhmake/src/mhmakefileparser.cpp
index cf41b3c1c..b198c1ca8 100644
--- a/tools/mhmake/src/mhmakefileparser.cpp
+++ b/tools/mhmake/src/mhmakefileparser.cpp
@@ -804,19 +804,6 @@ void mhmakefileparser::LoadAutoDepsFile(fileinfo *pDepFile)
fclose(pIn);
}
-static void MakeDirs(const fileinfo *pDir)
-{
- fileinfo *pParentDir=pDir->GetDir();
- if (!pParentDir->GetDate().DoesExist())
- { /* First make parent dirs */
- MakeDirs(pParentDir);
- }
- if (!pDir->GetDate().DoesExist())
- { /* Create directory */
- mkdir(pDir->GetFullFileName().c_str(),S_IRWXU);
- }
-}
-
void mhmakefileparser::SaveAutoDepsFile()
{
if (!IsAutoDepsDirty())
@@ -845,7 +832,14 @@ void mhmakefileparser::SaveAutoDepsFile()
if (!pOut)
{
/* Maybe it is because the directory does not exist, so try to create this first */
- MakeDirs(pDepFile->GetDir());
+ if (!MakeDirs(pDepFile->GetDir()))
+ {
+ #ifdef _DEBUG
+ if (!g_DoNotExecute)
+ #endif
+ cerr << "Error creating dir "<<pDepFile->GetDir()->GetFullFileName()<<endl;
+ return;
+ }
pOut=fopen(pDepFile->GetFullFileName().c_str(),"wb");
if (!pOut)