From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 13 14:33:16 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C60D038A for ; Tue, 13 Nov 2012 14:33:16 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 7E5CE8FC14 for ; Tue, 13 Nov 2012 14:33:14 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id qADEX6NN043579; Tue, 13 Nov 2012 07:33:06 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id qADEX6U7043576; Tue, 13 Nov 2012 07:33:06 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Tue, 13 Nov 2012 07:33:06 -0700 (MST) From: Warren Block To: Eitan Adler Subject: Re: Give users a hint when their locate database is too small. In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Tue, 13 Nov 2012 07:33:06 -0700 (MST) Cc: FreeBSD Hackers X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Nov 2012 14:33:16 -0000 On Mon, 12 Nov 2012, Eitan Adler wrote: > What do people think of this? Maybe /usr/libexec/locate.updatedb is a > better pointer? > > commit fb03b777daf2c69bb9612902e38fdb25b256be72 > Author: Eitan Adler > Date: Mon Nov 12 22:05:55 2012 -0500 > > Give users a hint when their locate database is too small. > > Reviwed by: ??? > Approved by: ??? > MFC after: 3 weeks > > diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c > index b0faefb..f0c8c37 100644 > --- a/usr.bin/locate/locate/locate.c > +++ b/usr.bin/locate/locate/locate.c > @@ -292,7 +292,7 @@ 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\nTry running /etc/periodic/weekly/310.locate", db); > > if ((p = mmap((caddr_t)0, (size_t)len, > PROT_READ, MAP_SHARED, > Don't use the unsure "try", just say "Run /etc/periodic/weekly/310.locate". And hope it doesn't get renumbered.