Give users a hint when their locate database is too small.

Reviewed by:	wblock, gcooper
Reviewed by:	"Lowell Gilbert" <lgfbsd@be-well.ilk.org>
Approved by:	cperciva (implicit)
MFC after:	3 weeks
This commit is contained in:
eadler 2012-12-10 02:26:01 +00:00
parent 02d1402204
commit 641397eb9a

View File

@ -292,7 +292,9 @@ search_mmap(db, s)
err(1, "`%s'", db);
len = sb.st_size;
if (len < (2*NBG))
errx(1, "database too small: %s", db);
errx(1,
"database too small: %s\nRun /usr/libexec/locate.updatedb",
db);
if ((p = mmap((caddr_t)0, (size_t)len,
PROT_READ, MAP_SHARED,