From fae7ff6f030d65bbb656028941c9254b214533a4 Mon Sep 17 00:00:00 2001 From: Denis Lisov Date: Mon, 2 May 2022 18:55:12 +0300 Subject: [PATCH] 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). --- linux/LinuxProcessList.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c index 0d4be558..14f3824a 100644 --- a/linux/LinuxProcessList.c +++ b/linux/LinuxProcessList.c @@ -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); } }