From: Craig Small Date: Thu, 14 Nov 2019 22:53:12 +0000 (+1100) Subject: pstree: additional for do not crash on missing processes X-Git-Tag: v23.4rc1~29^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b6c2b1288bd99f52d962301a2e41a0102d2a2d35;p=psmisc pstree: additional for do not crash on missing processes --- diff --git a/ChangeLog b/ChangeLog index 98464a1..4d13742 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Changes in NEXT +=============== + * pstree: Do not crash on missing processes !21 + Changes in 23.3 =============== * killall: check also truncated 16 char comm names Debian #912748 @@ -5,6 +9,7 @@ Changes in 23.3 * peekfd: Add support for ARM64 !19 * pstree: Add color by age #21 * fuser: Use larger inode sizes #16 + Changes in 23.2 =============== * misc: Command names increased from 16 to 64 characters diff --git a/src/pstree.c b/src/pstree.c index 3de0792..b05822e 100644 --- a/src/pstree.c +++ b/src/pstree.c @@ -1030,8 +1030,9 @@ static void read_proc(void) #ifdef WITH_SELINUX if (selinux_enabled) if (getpidcon(pid, &scontext) < 0) { - perror(path); - exit(1); + (void) fclose(file); + free(path); + continue; } #endif /*WITH_SELINUX */ if (stat(path, &st) < 0) {