From 11903063211dc368d03f52e090e52ab18ebe3f47 Mon Sep 17 00:00:00 2001 From: marha Date: Thu, 27 Jan 2011 13:44:12 +0000 Subject: Implemented mkdir as an internal command --- tools/mhmake/src/mhmakefileparser.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) (limited to 'tools/mhmake/src/mhmakefileparser.cpp') 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 "<GetDir()->GetFullFileName()<GetFullFileName().c_str(),"wb"); if (!pOut) -- cgit v1.2.3