Fri 07 Jan 2005 01:19:20 PM UTC, original submission:
Hello James,
Here's a patch that makes the findutils programs handle disk-full
(and I/O error, writing to closed stdout, etc.) conditions more robustly.
For example, without this change, running `find . > /dev/full' mistakenly
succeeds and gives no indication that there were write errors.
With the patch, I get this:
$ ./find . > /dev/full
./find: write error: No space left on device
2005-01-07 Jim Meyering <jim@meyering.net>
Report the error and fail when writing fails, e.g. to a full disk.
Before, each of these six programs would mistakenly exit successfully
when its standard output was redirected e.g., to a full disk.
- find/find.c: Include closeout.h
(main): Arrange to call close_stdout via atexit.
- locate/locate.c: Likewise.
- xargs/xargs.c: Likewise.
- locate/bigram.c: Likewise.
- locate/code.c: Likewise.
- locate/frcode.c: Likewise.
- import-gnulib.sh (findutils_modules): Add closeout.
Also, you might want to remove the unnecessary `../gnulib/lib/'
prefixes in #include directives, e.g., changing this:
#include "../gnulib/lib/xalloc.h"
to this:
#include "xalloc.h"
Jim
|