PreviewLoader: start fake pids after PID_MAX_LIMIT

(cherry picked from commit b67ff925e5)
This commit is contained in:
Scott Kostyshak 2020-03-28 19:12:25 -04:00 committed by Jean-Marc Lasgouttes
parent 3f14be7739
commit ebf09680da
2 changed files with 3 additions and 1 deletions

View File

@ -727,7 +727,8 @@ void PreviewLoader::Impl::startLoading(bool wait)
if (wait) {
ForkedCall call(buffer_.filePath(), buffer_.layoutPos());
int ret = call.startScript(ForkedProcess::Wait, command);
static atomic_int fake((1 << 20) + 1);
// PID_MAX_LIMIT is 2^22 so we start one after that
static atomic_int fake((1 << 22) + 1);
int pid = fake++;
inprogress.pid = pid;
inprogress.command = command;

View File

@ -68,6 +68,7 @@ What's new
* INTERNALS
- Fix wrong computation of what is an obviously fake PID number.
* DOCUMENTATION AND LOCALIZATION