From: Gunnar Beutner Date: Wed, 28 Aug 2013 08:48:19 +0000 (+0200) Subject: Add error info for ftruncate() call. X-Git-Tag: v0.0.3~680 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58a932ab6fd7ada6593f32941dbc9182525475b0;p=icinga2 Add error info for ftruncate() call. --- diff --git a/lib/base/application.cpp b/lib/base/application.cpp index 0b46d6b58..423987bcb 100644 --- a/lib/base/application.cpp +++ b/lib/base/application.cpp @@ -503,7 +503,11 @@ void Application::UpdatePidFile(const String& filename) _exit(EXIT_FAILURE); } - (void) ftruncate(fd, 0); + if (ftruncate(fd, 0) < 0) { + BOOST_THROW_EXCEPTION(posix_error() + << boost::errinfo_api_function("ftruncate") + << boost::errinfo_errno(errno)); + } #endif /* _WIN32 */ fprintf(m_PidFile, "%d", Utility::GetPid());