From 641397eb9a7e8ad64ec02351d1a77decf3be058e Mon Sep 17 00:00:00 2001 From: eadler Date: Mon, 10 Dec 2012 02:26:01 +0000 Subject: 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(-) (limited to 'usr.bin/locate') diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c index b0faefb..3a87b14 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, -- cgit v1.1