Add error info for ftruncate() call.

This commit is contained in:
Gunnar Beutner 2013-08-28 10:48:19 +02:00
parent f39f69d390
commit 58a932ab6f
1 changed files with 5 additions and 1 deletions

View File

@ -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());