Small windows build adjustments
This commit is contained in:
@@ -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),
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user