summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Goddard Rosa <andre.rosa@lge.com>2018-08-26 15:37:30 (GMT)
committerDenys Vlasenko <vda.linux@googlemail.com>2018-08-26 15:37:30 (GMT)
commit9a2621a3b9243919921935f0e3eff6d942379e77 (patch)
treeba5aba3c797834c02c5c854ca63162e1f6140f36
parent9d539f9fbd0dc4ea70ed8ba66e3c78150fa8a8b2 (diff)
downloadbusybox-9a2621a3b9243919921935f0e3eff6d942379e77.tar.gz
busybox-9a2621a3b9243919921935f0e3eff6d942379e77.tar.bz2
smemcap: keep outputting by ignoring transient processes
function old new delta archivefile 167 176 +9 Signed-off-by: Andre Goddard Rosa <andre.rosa@lge.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--procps/smemcap.c4
1 files changed, 4 insertions, 0 deletions
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;