From: Michael Friedrich Date: Wed, 11 Mar 2015 15:06:04 +0000 (+0100) Subject: Make sure that the /var/log/icinga2/crash directory exists X-Git-Tag: v2.3.1~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9db3d4213554ebfe4a6bbbb236572340ec0d9612;p=icinga2 Make sure that the /var/log/icinga2/crash directory exists fixes #8683 --- diff --git a/lib/base/application.cpp b/lib/base/application.cpp index b0a0ad4b2..daa4a3fcd 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -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());