diff options
| author | dyoung <dyoung@NetBSD.org> | 2006-02-26 03:00:16 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2006-02-26 03:00:16 +0000 |
| commit | dd269ac542ec149dfce1efc2e7586509d34c9ff1 (patch) | |
| tree | b237191a7c2b094fde4b1b51ae7f33a3ea6fc5f5 /usr.bin/locate | |
| parent | 120c0e6d94ede50f077e5c9214ff6ba53a65f5b2 (diff) | |
This patch removes one possible cause for a prolonged "out of disk"
condition on /tmp/: if creating the file list ($FILELIST) fails,
immediately exit with a non-zero result code. This fixes a bug
where, if the file list filled /tmp/, updatedb.sh would nevertheless
run for several minutes before it removed the file list as it quit.
Diffstat (limited to 'usr.bin/locate')
| -rw-r--r-- | usr.bin/locate/locate/updatedb.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/locate/locate/updatedb.sh b/usr.bin/locate/locate/updatedb.sh index daaafeecfdd..5ffaaec45ad 100644 --- a/usr.bin/locate/locate/updatedb.sh +++ b/usr.bin/locate/locate/updatedb.sh @@ -1,6 +1,6 @@ #!/bin/sh # -# $NetBSD: updatedb.sh,v 1.9 2004/04/19 01:05:22 lukem Exp $ +# $NetBSD: updatedb.sh,v 1.10 2006/02/26 03:00:16 dyoung Exp $ # # Copyright (c) 1989, 1993 # The Regents of the University of California. All rights reserved. @@ -116,7 +116,9 @@ trap "rm -f '$FILELIST'; exit 1" INT QUIT TERM # Entries of each directory shall be sorted (find -s). set -f -find -s ${SRCHPATHS} $lp $ignorefs $ignore $rp -print >> "$FILELIST" +if ! find -s ${SRCHPATHS} $lp $ignorefs $ignore $rp -print >> "$FILELIST"; then + exit 1 +fi BIGRAMS=`$LIBDIR/locate.bigram <"$FILELIST"` |
