Give users a hint when their locate database is too small.

Benjamin Kaduk kaduk at MIT.EDU
Wed Nov 14 04:15:30 UTC 2012


On Tue, 13 Nov 2012, Eitan Adler wrote:

>
> Ack to all. Final patch sent for approval:
>
> diff --git a/usr.bin/locate/locate/locate.c b/usr.bin/locate/locate/locate.c
> index b0faefb..95b3fed 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\nRun /usr/libexec/locate.updatedb", db);

That looks longer than 80 characters, a limit given implicitly in style.9.

-Ben


>
> 	if ((p = mmap((caddr_t)0, (size_t)len,
> 		      PROT_READ, MAP_SHARED,
>
> -- 
> Eitan Adler
> _______________________________________________
> freebsd-hackers at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe at freebsd.org"
>


More information about the freebsd-hackers mailing list