From 93d24a8730fc12f71d7b831305adafacca36d70a Mon Sep 17 00:00:00 2001 From: Eitan Adler Date: Mon, 10 Dec 2012 02:26:01 +0000 Subject: [PATCH] Give users a hint when their locate database is too small. Reviewed by: wblock, gcooper Reviewed by: "Lowell Gilbert" Approved by: cperciva (implicit) MFC after: 3 weeks --- usr.bin/locate/locate/locate.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index b0faefbf63f..3a87b14a0de 100644 --- a/usr.bin/locate/locate/locate.c +++ b/usr.bin/locate/locate/locate.c @@ -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,