From 9a2621a3b9243919921935f0e3eff6d942379e77 Mon Sep 17 00:00:00 2001 From: Andre Goddard Rosa Date: Sun, 26 Aug 2018 17:37:30 +0200 Subject: smemcap: keep outputting by ignoring transient processes function old new delta archivefile 167 176 +9 Signed-off-by: Andre Goddard Rosa Signed-off-by: Denys Vlasenko --- procps/smemcap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/procps/smemcap.c b/procps/smemcap.c index 81f4caf..96b565f 100644 --- a/procps/smemcap.c +++ b/procps/smemcap.c @@ -66,6 +66,10 @@ static void archivefile(const char *path) /* buffer the file */ fd = xopen(path, O_RDONLY); + if (fd == -1) { + /* skip vanished processes between dir listing and traversal */ + return; + } do { cur = xzalloc(sizeof(*cur)); *prev = cur; -- cgit v1.1