got rid of a number of ifdefs which should not be needed anymore

This commit is contained in:
Jean-Francois Dockes 2015-10-08 14:48:50 +02:00
parent d373565e0c
commit f6cbe86e3e
5 changed files with 4 additions and 20 deletions

View file

@ -52,9 +52,7 @@ void initAsyncSigs(void (*sigcleanup)(int))
{ {
// We ignore SIGPIPE always. All pieces of code which can write to a pipe // We ignore SIGPIPE always. All pieces of code which can write to a pipe
// must check write() return values. // must check write() return values.
#ifndef _WIN32
signal(SIGPIPE, SIG_IGN); signal(SIGPIPE, SIG_IGN);
#endif
// Install app signal handler // Install app signal handler
if (sigcleanup) { if (sigcleanup) {
@ -213,9 +211,7 @@ RclConfig *recollinit(RclInitFlags flags,
unac_set_except_translations(unacex.c_str()); unac_set_except_translations(unacex.c_str());
#ifndef IDX_THREADS #ifndef IDX_THREADS
#ifndef _WIN32
ExecCmd::useVfork(true); ExecCmd::useVfork(true);
#endif
#else #else
// Keep threads init behind log init, but make sure it's done before // Keep threads init behind log init, but make sure it's done before
// we do the vfork choice ! The latter is not used any more actually, // we do the vfork choice ! The latter is not used any more actually,
@ -225,15 +221,11 @@ RclConfig *recollinit(RclInitFlags flags,
bool novfork; bool novfork;
config->getConfParam("novfork", &novfork); config->getConfParam("novfork", &novfork);
if (novfork) { if (novfork) {
#ifndef _WIN32
LOGDEB0(("rclinit: will use fork() for starting commands\n")); LOGDEB0(("rclinit: will use fork() for starting commands\n"));
ExecCmd::useVfork(false); ExecCmd::useVfork(false);
#endif
} else { } else {
#ifndef _WIN32
LOGDEB0(("rclinit: will use vfork() for starting commands\n")); LOGDEB0(("rclinit: will use vfork() for starting commands\n"));
ExecCmd::useVfork(true); ExecCmd::useVfork(true);
#endif
} }
#endif #endif

View file

@ -28,6 +28,9 @@ using namespace std;
bool checkRetryFailed(RclConfig *conf, bool record) bool checkRetryFailed(RclConfig *conf, bool record)
{ {
#ifdef _WIN32
return true;
#else
string cmd; string cmd;
if (!conf->getConfParam("checkneedretryindexscript", cmd)) { if (!conf->getConfParam("checkneedretryindexscript", cmd)) {
@ -51,4 +54,5 @@ bool checkRetryFailed(RclConfig *conf, bool record)
return true; return true;
} }
return false; return false;
#endif
} }

View file

@ -556,11 +556,9 @@ int main(int argc, char **argv)
if (op_flags & OPT_k) { if (op_flags & OPT_k) {
indexerFlags &= ~ConfIndexer::IxFNoRetryFailed; indexerFlags &= ~ConfIndexer::IxFNoRetryFailed;
} else { } else {
#ifndef _WIN32
if (checkRetryFailed(config, false)) { if (checkRetryFailed(config, false)) {
indexerFlags &= ~ConfIndexer::IxFNoRetryFailed; indexerFlags &= ~ConfIndexer::IxFNoRetryFailed;
} }
#endif
} }
Pidfile pidfile(config->getPidfile()); Pidfile pidfile(config->getPidfile());
@ -684,12 +682,10 @@ int main(int argc, char **argv)
"not going into monitor mode\n")); "not going into monitor mode\n"));
exit(1); exit(1);
} else { } else {
#ifndef _WIN32
// Record success of indexing pass with failed files retries. // Record success of indexing pass with failed files retries.
if (!(indexerFlags & ConfIndexer::IxFNoRetryFailed)) { if (!(indexerFlags & ConfIndexer::IxFNoRetryFailed)) {
checkRetryFailed(config, true); checkRetryFailed(config, true);
} }
#endif
} }
deleteZ(confindexer); deleteZ(confindexer);
#ifndef _WIN32 #ifndef _WIN32
@ -727,12 +723,10 @@ int main(int argc, char **argv)
makeIndexerOrExit(config, inPlaceReset); makeIndexerOrExit(config, inPlaceReset);
bool status = confindexer->index(rezero, ConfIndexer::IxTAll, bool status = confindexer->index(rezero, ConfIndexer::IxTAll,
indexerFlags); indexerFlags);
#ifndef _WIN32
// Record success of indexing pass with failed files retries. // Record success of indexing pass with failed files retries.
if (status && !(indexerFlags & ConfIndexer::IxFNoRetryFailed)) { if (status && !(indexerFlags & ConfIndexer::IxFNoRetryFailed)) {
checkRetryFailed(config, true); checkRetryFailed(config, true);
} }
#endif
if (!status) if (!status)
cerr << "Indexing failed" << endl; cerr << "Indexing failed" << endl;
if (!confindexer->getReason().empty()) if (!confindexer->getReason().empty())

View file

@ -94,7 +94,6 @@ void docFieldsFromXattrs(RclConfig *cfg, const map<string, string>& xfields,
void reapMetaCmds(RclConfig* cfg, const string& path, void reapMetaCmds(RclConfig* cfg, const string& path,
map<string, string>& cfields) map<string, string>& cfields)
{ {
#ifndef _WIN32
const vector<MDReaper>& reapers = cfg->getMDReapers(); const vector<MDReaper>& reapers = cfg->getMDReapers();
if (reapers.empty()) if (reapers.empty())
return; return;
@ -113,7 +112,6 @@ void reapMetaCmds(RclConfig* cfg, const string& path,
cfields[rp->fieldname] = output; cfields[rp->fieldname] = output;
} }
} }
#endif
} }
// Set fields from external commands // Set fields from external commands

View file

@ -109,12 +109,8 @@ bool Uncomp::uncompressfile(const string& ifn,
} }
// Execute command and retrieve output file name, check that it exists // Execute command and retrieve output file name, check that it exists
#ifndef _WIN32
ExecCmd ex; ExecCmd ex;
int status = ex.doexec(cmd, args, 0, &tfile); int status = ex.doexec(cmd, args, 0, &tfile);
#else
int status = -1;
#endif
if (status || tfile.empty()) { if (status || tfile.empty()) {
LOGERR(("uncompressfile: doexec: failed for [%s] status 0x%x\n", LOGERR(("uncompressfile: doexec: failed for [%s] status 0x%x\n",
ifn.c_str(), status)); ifn.c_str(), status));