du(1): Move the fts_close() behind fts_read()'s errno check.
authorSascha Wildner <saw@online.de>
Sat, 3 Dec 2011 09:39:06 +0000 (10:39 +0100)
committerSascha Wildner <saw@online.de>
Sat, 3 Dec 2011 09:39:06 +0000 (10:39 +0100)
usr.bin/du/du.c

index a729ef5..62c8396 100644 (file)
@@ -279,11 +279,12 @@ main(int argc, char **argv)
                if (p->fts_parent->fts_pointer)
                        savednumber = *(du_number_t *)p->fts_parent->fts_pointer;
        }
-       fts_close(fts);
 
        if (errno)
                err(1, "fts_read");
 
+       fts_close(fts);
+
        if (cflag) {
                if (hflag) {
                        (void) prthumanval(howmany(savednumber, blocksize));