udhcpc: code shrink
[oweals/busybox.git] / procps / smemcap.c
index 81f4cafad084f7eff06a90406adc14cd319efa7e..2f8ab192e2101c8445cee79c9299534d3b482ed1 100644 (file)
@@ -65,7 +65,11 @@ static void archivefile(const char *path)
        struct stat s;
 
        /* buffer the file */
-       fd = xopen(path, O_RDONLY);
+       fd = open(path, O_RDONLY);
+       if (fd == -1) {
+               /* skip vanished processes between dir listing and traversal */
+               return;
+       }
        do {
                cur = xzalloc(sizeof(*cur));
                *prev = cur;