]> granicus.if.org Git - icinga2/commitdiff
Make sure that the /var/log/icinga2/crash directory exists
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 11 Mar 2015 15:06:04 +0000 (16:06 +0100)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 11 Mar 2015 15:08:37 +0000 (16:08 +0100)
fixes #8683

lib/base/application.cpp

index b0a0ad4b2f174782fd0ae3ce2b0b4888c5cea5f4..daa4a3fcdfd4f911e0a8ed3b21ba64eb1d27ceef 100644 (file)
@@ -624,6 +624,8 @@ void Application::SigAbrtHandler(int)
                  << std::endl;
 
        String fname = GetCrashReportFilename();
+       Utility::MkDir(Utility::DirName(fname), 0750);
+
        std::ofstream ofs;
        ofs.open(fname.CStr());
 
@@ -682,6 +684,8 @@ void Application::ExceptionHandler(void)
 #endif /* _WIN32 */
 
        String fname = GetCrashReportFilename();
+       Utility::MkDir(Utility::DirName(fname), 0750);
+
        std::ofstream ofs;
        ofs.open(fname.CStr());
 
@@ -724,6 +728,8 @@ LONG CALLBACK Application::SEHUnhandledExceptionFilter(PEXCEPTION_POINTERS exi)
        l_InExceptionHandler = true;
 
        String fname = GetCrashReportFilename();
+       Utility::MkDir(Utility::DirName(fname), 0750);
+
        std::ofstream ofs;
        ofs.open(fname.CStr());