Merge pull request #743 from pyroscope/fix-log-xmlrpc-close

fix: properly close the XMLRPC log, resetting the handle after close
This commit is contained in:
Jari Sundell
2018-06-16 18:46:11 +09:00
committed by GitHub
+5 -4
View File
@@ -113,14 +113,15 @@ ThreadWorker::change_xmlrpc_log() {
if (scgi() == NULL)
return;
if (scgi()->log_fd() != -1)
if (scgi()->log_fd() != -1) {
::close(scgi()->log_fd());
if (m_xmlrpcLog.empty()) {
scgi()->set_log_fd(-1);
control->core()->push_log("Closed XMLRPC log.");
return;
}
if (m_xmlrpcLog.empty())
return;
scgi()->set_log_fd(open(rak::path_expand(m_xmlrpcLog).c_str(), O_WRONLY | O_APPEND | O_CREAT, 0644));
if (scgi()->log_fd() == -1) {