LinuxProcessList_recurseProcTree: keep on read error

If a process goes away while reading its fields, but we already have
that process in the list, we should keep it in case the "highlight dying
processes" mode is active. Not only is that expected in this mode, but
this should also ensure parents are in the list when their children are
(wanted for tree mode consistency).
This commit is contained in:
Denis Lisov 2022-05-02 18:55:12 +03:00 committed by BenBE
parent e07fce7014
commit fae7ff6f03
1 changed files with 6 additions and 1 deletions

View File

@ -1653,8 +1653,13 @@ errorReadingProcess:
#endif
if (preExisting) {
ProcessList_remove(pl, proc);
/*
* The only real reason for coming here (apart from Linux violating the /proc API)
* would be the process going away with its /proc files disappearing (!HAVE_OPENAT).
* However, we want to keep in the process list for now for the "highlight dying" mode.
*/
} else {
/* A really short-lived process that we don't have full info about */
Process_delete((Object*)proc);
}
}