From: H.G.Muller Date: Mon, 17 Jun 2019 11:55:52 +0000 (+0200) Subject: Do not nice nice-aware adapters X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=6b605eb76af34278861a1810cc467dbb1726daea;p=xboard.git Do not nice nice-aware adapters It is the engine process we want to run at lower priority, not the adapter it is running through. So if we know the engine is running through an adapter, because we invoked it ourselves due to -f/sUCI, and we pass the adapter the value of the -niceEngines option (presumably for it to set the priority of the engine it forks off by itself), we refrain from nicing it. --- diff --git a/backend.c b/backend.c index 47b426d..a3220c2 100644 --- a/backend.c +++ b/backend.c @@ -11176,13 +11176,15 @@ void StartChessProgram (ChessProgramState *cps) { char buf[MSG_SIZ]; - int err; + int err, priority = appData.niceEngines; if (appData.noChessProgram) return; cps->initDone = FALSE; + if(cps->isUCI && strstr(appData.adapterCommand, "%niceEngines")) priority = 0; // no nicing on nice adapters! + if (strcmp(cps->host, "localhost") == 0) { - err = StartChildProcess(cps->program, cps->dir, &cps->pr, appData.niceEngines); + err = StartChildProcess(cps->program, cps->dir, &cps->pr, priority); } else if (*appData.remoteShell == NULLCHAR) { err = OpenRcmd(cps->host, appData.remoteUser, cps->program, &cps->pr); } else { @@ -11193,7 +11195,7 @@ StartChessProgram (ChessProgramState *cps) snprintf(buf, sizeof(buf), "%s %s -l %s %s", appData.remoteShell, cps->host, appData.remoteUser, cps->program); } - err = StartChildProcess(buf, "", &cps->pr, appData.niceEngines); + err = StartChildProcess(buf, "", &cps->pr, priority); } if (err != 0) {