From owner-freebsd-hackers@FreeBSD.ORG Tue Nov 13 15:55:34 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 654A1517 for ; Tue, 13 Nov 2012 15:55:34 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-la0-f54.google.com (mail-la0-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id C34A38FC08 for ; Tue, 13 Nov 2012 15:55:33 +0000 (UTC) Received: by mail-la0-f54.google.com with SMTP id j13so747230lah.13 for ; Tue, 13 Nov 2012 07:55:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=oLQ1npUwCnknzC1bytV28FSMzsyuG9Mk3UvrB5XA/38=; b=QQ4id9AeLqcJG78+lX0/UrAAUZGir8O47j5T770Oe3hlG/VTYuEZXh7Ts2DiIgYMqM oGoE2yNVI4OXDj6jEJN7wV8uXQzJq3mWoAa85NfnYMqr3893JCC1etcO8d2F4RMLLoYR tqCRn/gL9+TeTivFoOEMUMVwZQPT5HHOVRfV0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:x-gm-message-state; bh=oLQ1npUwCnknzC1bytV28FSMzsyuG9Mk3UvrB5XA/38=; b=XvYkKPI5MNCFGdGqjsis0OQyh2iFeN3GOmJAsxbCNMsNLFDxyhJwTstXm9Vj1ChE3v UerxiH+PYS7dXEZy4T8ZuevefjAbtADhvu1Vou+v5E+7YvLupvNl+7ivIeclbBVASr5u /ITMfWlKwkFHbN/O4KhY7wNZJRSKwEBKxVVLa3zOF88LoJZpshmZeFfoyNBtCt05MEAM tDw6iuatuemr8m/piPZ4UMxZmqOAC1vKs0Pnr9gqErg7Zi3EeK8Puiv3oe6f324x3irH rVtxi6b3sAydo/hss2IabgN982/QIh33vVzhkoplvqtn6tIhlC4EW0F9fufsQMChl845 7Awg== Received: by 10.112.100.102 with SMTP id ex6mr9655237lbb.130.1352822132425; Tue, 13 Nov 2012 07:55:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.25.166 with HTTP; Tue, 13 Nov 2012 07:55:02 -0800 (PST) In-Reply-To: References: From: Eitan Adler Date: Tue, 13 Nov 2012 10:55:02 -0500 Message-ID: Subject: Re: Give users a hint when their locate database is too small. To: Warren Block Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQnANtCs7s/t/wFKJYwLSVGyUbkD977xxo57Djr18meGzRNRWp4bDKEqU1rMJxk7JvuLILvj 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 15:55:34 -0000 On 13 November 2012 09:33, Warren Block wrote: ... Ack to all. Final patch sent for approval: commit 33ed38e54bf7c7c5f0531afa5501f501e1a67279 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: wblock Reviewed by: gcooper Reviwed by: "Lowell Gilbert" Approved by: cperciva MFC after: 3 weeks 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); if ((p = mmap((caddr_t)0, (size_t)len, PROT_READ, MAP_SHARED, -- Eitan Adler