From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 13 08:37:10 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 9A09D976 for ; Tue, 13 Nov 2012 08:37:10 +0000 (UTC) (envelope-from lars@e-new.0x20.net) Received: from mail.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) by mx1.freebsd.org (Postfix) with ESMTP id 4FDE58FC0C for ; Tue, 13 Nov 2012 08:37:10 +0000 (UTC) Received: from e-new.0x20.net (mail.0x20.net [IPv6:2001:aa8:fffb:1::3]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.0x20.net (Postfix) with ESMTPS id 8A5B36A6004; Tue, 13 Nov 2012 09:37:09 +0100 (CET) Received: from e-new.0x20.net (localhost [127.0.0.1]) by e-new.0x20.net (8.14.5/8.14.5) with ESMTP id qAD8b9H0034687; Tue, 13 Nov 2012 09:37:09 +0100 (CET) (envelope-from lars@e-new.0x20.net) Received: (from lars@localhost) by e-new.0x20.net (8.14.5/8.14.5/Submit) id qAD8b9mk033364; Tue, 13 Nov 2012 09:37:09 +0100 (CET) (envelope-from lars) Date: Tue, 13 Nov 2012 09:37:09 +0100 From: Lars Engels To: Eitan Adler Subject: Re: Give users a hint when their locate database is too small. Message-ID: <20121113083709.GC96846@e-new.0x20.net> References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="eRtJSFbw+EEWtPj3" Content-Disposition: inline In-Reply-To: X-Editor: VIM - Vi IMproved 7.3 X-Operation-System: FreeBSD 8.3-RELEASE-p4 User-Agent: Mutt/1.5.21 (2010-09-15) X-Mailman-Approved-At: Tue, 13 Nov 2012 12:23:53 +0000 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 08:37:10 -0000 --eRtJSFbw+EEWtPj3 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 12, 2012 at 10:07:16PM -0500, Eitan Adler wrote: > What do people think of this? Maybe /usr/libexec/locate.updatedb is a > better pointer? >=20 > commit fb03b777daf2c69bb9612902e38fdb25b256be72 > Author: Eitan Adler > Date: Mon Nov 12 22:05:55 2012 -0500 >=20 > Give users a hint when their locate database is too small. >=20 > Reviwed by: ??? > Approved by: ??? > MFC after: 3 weeks >=20 > diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locat= e.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 =3D 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); >=20 > if ((p =3D mmap((caddr_t)0, (size_t)len, > PROT_READ, MAP_SHARED, >=20 Enlarge your .... database! ;-) --eRtJSFbw+EEWtPj3 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlCiBrUACgkQKc512sD3afj3mgCfQBf0+cjXnsP/BXKyBNjNn8Vn CLoAn0REvYsefzf0LRKzl5UdhIoMpb92 =vfFD -----END PGP SIGNATURE----- --eRtJSFbw+EEWtPj3--