Windows: small adjustments to new aspell management.
This commit is contained in:
@@ -760,7 +760,7 @@ int ExecCmd::startExec(const string &cmd, const vector<string>& args,
|
||||
if (!m->preparePipes(has_input, &hInputRead, has_output,
|
||||
&hOutputWrite, &hErrorWrite)) {
|
||||
LOGERR("ExecCmd::startExec: preparePipes failed\n");
|
||||
return false;
|
||||
return -1;
|
||||
}
|
||||
|
||||
STARTUPINFOW siStartInfo;
|
||||
@@ -820,7 +820,7 @@ int ExecCmd::startExec(const string &cmd, const vector<string>& args,
|
||||
if (bSuccess) {
|
||||
cleaner.inactivate();
|
||||
}
|
||||
return bSuccess;
|
||||
return bSuccess ? 0 : -1;
|
||||
}
|
||||
|
||||
// Send data to the child.
|
||||
@@ -1011,6 +1011,29 @@ int ExecCmd::getline(string& data)
|
||||
return -1;
|
||||
}
|
||||
|
||||
class GetlineWatchdog : public ExecCmdAdvise {
|
||||
public:
|
||||
GetlineWatchdog(int secs) : m_secs(secs), tstart(time(0)) {}
|
||||
void newData(int) {
|
||||
if (time(0) - tstart >= m_secs) {
|
||||
throw std::runtime_error("getline timeout");
|
||||
}
|
||||
}
|
||||
int m_secs;
|
||||
time_t tstart;
|
||||
};
|
||||
|
||||
int ExecCmd::getline(string& data, int timeosecs)
|
||||
{
|
||||
GetlineWatchdog gwd(timeosecs);
|
||||
setAdvise(&gwd);
|
||||
try {
|
||||
return getline(data);
|
||||
} catch (...) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
int ExecCmd::wait()
|
||||
{
|
||||
// If killRequest was set, we don't perform the normal
|
||||
|
||||
@@ -55,9 +55,7 @@ else
|
||||
export PATH
|
||||
fi
|
||||
|
||||
# We use the mingw-compiled aspell program in both cases. When
|
||||
# compiling with msvc, we copy the msvc dll to the recoll top dir (and
|
||||
# don't use the exec, we keep the already tested mingw one).
|
||||
# We use the mingw-compiled aspell program in both cases, it's only executed as a command
|
||||
ASPELL=${RCLDEPS}/mingw/aspell-0.60.7/aspell-installed
|
||||
|
||||
# Where to find libgcc_s_dw2-1.dll et all for progs compiled with
|
||||
@@ -316,9 +314,6 @@ copyaspell()
|
||||
chkcp $MINGWBIN/libgcc_s_dw2-1.dll $DEST
|
||||
chkcp $MINGWBIN/libstdc++-6.dll $DEST
|
||||
chkcp $MINGWBIN/libwinpthread-1.dll $DEST
|
||||
if test $BUILD = MSVC ; then
|
||||
chkcp $RCLDEPS/mingw/build-libaspell-Desktop_Qt_5_14_2_MSVC2017_32bit-Release/release/aspell.dll $DESTDIR/libaspell-15.dll
|
||||
fi
|
||||
}
|
||||
|
||||
# Recoll python package. Only when compiled with msvc as this is what
|
||||
|
||||
Reference in New Issue
Block a user