debug info to trace down "cannot rename temp session file" errors

..but actually, the real error may be concurrent
calls to Session::save_state()
This commit is contained in:
Robin Gareus 2014-07-05 20:53:22 +02:00
parent 63d81d2419
commit c9b0f0fcb7
1 changed files with 14 additions and 0 deletions

View File

@ -155,6 +155,20 @@ XMLTree::write() const
xmlSetDocCompressMode(doc, _compression);
writenode(doc, _root, doc->children, 1);
result = xmlSaveFormatFileEnc(_filename.c_str(), doc, "UTF-8", 1);
#ifndef NDEBUG
if (result == -1) {
xmlErrorPtr xerr = xmlGetLastError ();
if (!xerr) {
std::cerr << "unknown XML error during xmlSaveFormatFileEnc()." << std::endl;
} else {
std::cerr << "xmlSaveFormatFileEnc: error"
<< " domain: " << xerr->domain
<< " code: " << xerr->code
<< " msg: " << xerr->message
<< std::endl;
}
}
#endif
xmlFreeDoc(doc);
if (result == -1) {