indexing log: fix idx/daemlogfilename not working as expected
This commit is contained in:
parent
92e172cad0
commit
9481bc1ab4
@ -248,7 +248,7 @@ void recoll_exitready()
|
||||
|
||||
#endif
|
||||
|
||||
RclConfig *recollinit(RclInitFlags flags,
|
||||
RclConfig *recollinit(int flags,
|
||||
void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
string &reason, const string *argcnf)
|
||||
{
|
||||
@ -281,10 +281,14 @@ RclConfig *recollinit(RclInitFlags flags,
|
||||
config->getConfParam(string("daemlogfilename"), logfilename);
|
||||
config->getConfParam(string("daemloglevel"), loglevel);
|
||||
}
|
||||
if ((flags & RCLINIT_IDX) && logfilename.empty())
|
||||
config->getConfParam(string("idxlogfilename"), logfilename);
|
||||
if ((flags & RCLINIT_IDX) && loglevel.empty())
|
||||
config->getConfParam(string("idxloglevel"), loglevel);
|
||||
if (flags & RCLINIT_IDX) {
|
||||
if (logfilename.empty()) {
|
||||
config->getConfParam(string("idxlogfilename"), logfilename);
|
||||
}
|
||||
if (loglevel.empty()) {
|
||||
config->getConfParam(string("idxloglevel"), loglevel);
|
||||
}
|
||||
}
|
||||
|
||||
if (logfilename.empty())
|
||||
config->getConfParam(string("logfilename"), logfilename);
|
||||
|
||||
@ -40,7 +40,7 @@ class RclConfig;
|
||||
* @return the parsed configuration.
|
||||
*/
|
||||
enum RclInitFlags {RCLINIT_NONE = 0, RCLINIT_DAEMON = 1, RCLINIT_IDX = 2};
|
||||
extern RclConfig *recollinit(RclInitFlags flags,
|
||||
extern RclConfig *recollinit(int flags,
|
||||
void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
std::string& reason, const string *argcnf = 0);
|
||||
inline RclConfig *recollinit(void (*cleanup)(void), void (*sigcleanup)(int),
|
||||
|
||||
@ -624,8 +624,10 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
string reason;
|
||||
RclInitFlags flags = (op_flags & OPT_m) && !(op_flags&OPT_D) ?
|
||||
RCLINIT_DAEMON : RCLINIT_IDX;
|
||||
int flags = RCLINIT_IDX;
|
||||
if ((op_flags & OPT_m) && !(op_flags&OPT_D)) {
|
||||
flags |= RCLINIT_DAEMON;
|
||||
}
|
||||
config = recollinit(flags, cleanup, sigcleanup, reason, &a_config);
|
||||
if (config == 0 || !config->ok()) {
|
||||
addIdxReason("init", reason);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user