Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Nov 2012 09:05:46 -0500
From:      Lowell Gilbert <lgfbsd@be-well.ilk.org>
To:        Eitan Adler <lists@eitanadler.com>, freebsd-hackers@freebsd.org
Subject:   Re: Give users a hint when their locate database is too small.
Message-ID:  <44wqxpegxx.fsf@lowell-desk.lan>
In-Reply-To: <CAF6rxgkXXmSsoPHNVe6RLGpQ1C-qUq_y4YQSo3YgPhAeTdJAyQ@mail.gmail.com> (Eitan Adler's message of "Mon, 12 Nov 2012 22:07:16 -0500")
References:  <CAF6rxgkXXmSsoPHNVe6RLGpQ1C-qUq_y4YQSo3YgPhAeTdJAyQ@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Eitan Adler <lists@eitanadler.com> writes:

> What do people think of this? Maybe /usr/libexec/locate.updatedb is a
> better pointer?

Yes, I would think locate.updatedb(8) would be the appropriate
reference, because it's possible to build locate databases in ways and
for reasons other than the weekly script.

I assume that the precise cutoff value is chosen not because the number
of bigrams is important but because the size of the bigram buffer is,
and that it's only notated as (2*NBG) because BGBUFSIZE isn't defined in
a header...

> commit fb03b777daf2c69bb9612902e38fdb25b256be72
> Author: Eitan Adler <lists@eitanadler.com>
> 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,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?44wqxpegxx.fsf>