mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-08 11:12:31 +00:00
fix: properly close the XMLRPC log, resetting the handle after close
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user