> Date: Sat, 31 Dec 2011 11:39:23 -0500 (EST)
> From: logana...@devio.us (Loganaden Velvindron)
> 
> In du.c, fts_close() is missing before exit.
> fts_close() may also return -1 on hitting an
> error.

And what are you going to do if it does?  Print an annoying error
message after everything the user was interested has been printed
successfully?

> Index: usr.bin/du/du.c
> ===================================================================
> RCS file: /cvs/src/usr.bin/du/du.c,v
> retrieving revision 1.23
> diff -u -p -r1.23 du.c
> --- usr.bin/du/du.c   27 Apr 2011 07:52:11 -0000      1.23
> +++ usr.bin/du/du.c   31 Dec 2011 16:29:26 -0000
> @@ -202,6 +202,10 @@ main(int argc, char *argv[])
>               }
>       if (errno)
>               err(1, "fts_read");
> +     
> +     if (fts_close(fts) == -1)
> +             err(1, "fts_close");
> +     
>       if (cflag) {
>               prtout((quad_t)howmany(totalblocks, blocksize), "total", hflag);
>       }

Reply via email to