Small windows build adjustments

This commit is contained in:
Jean-Francois Dockes
2017-09-04 09:59:37 +02:00
parent cd6ee917c1
commit 799190b702
4 changed files with 24 additions and 17 deletions
+11
View File
@@ -36,6 +36,17 @@
#include "rclaspell.h"
#endif
// This would more logically live in recollindex.cpp, but then librecoll would
// have an undefined symbol
ConfSimple idxreasons;
void addIdxReason(string who, string reason)
{
reason = neutchars(reason, "\r\n");
if (!idxreasons.set(who, reason)) {
std::cerr << "addIdxReason: confsimple set failed\n";
}
}
ConfIndexer::ConfIndexer(RclConfig *cnf, DbIxStatusUpdater *updfunc)
: m_config(cnf), m_db(cnf), m_fsindexer(0),
m_dobeagle(false), m_beagler(0),
+5 -12
View File
@@ -405,31 +405,24 @@ void lockorexit(Pidfile *pidfile)
}
}
static ConfSimple reasons;
static string reasonsfile;
void addIdxReason(string who, string reason)
{
reason = neutchars(reason, "\r\n");
if (!reasons.set(who, reason)) {
cerr << "addIdxReason: confsimple set failed\n";
}
}
extern ConfSimple idxreasons;
static void flushIdxReasons()
{
if (reasonsfile.empty())
return;
if (reasonsfile == "stdout") {
reasons.write(cout);
idxreasons.write(cout);
} else if (reasonsfile == "stderr") {
reasons.write(cerr);
idxreasons.write(std::cerr);
} else {
ofstream out;
try {
out.open(reasonsfile, ofstream::out|ofstream::trunc);
reasons.write(out);
idxreasons.write(out);
} catch (...) {
cerr << "Could not write reasons file " << reasonsfile << endl;
reasons.write(cerr);
idxreasons.write(cerr);
}
}
}