Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 498466DE014D for ; Mon, 27 Jun 2016 13:43:20 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.005 X-Spam-Level: X-Spam-Status: No, score=-0.005 tagged_above=-999 required=5 tests=[AWL=-0.006, HEADER_FROM_DIFFERENT_DOMAINS=0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id rEoYwybtVG9H for ; Mon, 27 Jun 2016 13:43:12 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id 52E386DE00CC for ; Mon, 27 Jun 2016 13:43:11 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84) (envelope-from ) id 1bHdMr-0006WM-6H; Mon, 27 Jun 2016 16:42:53 -0400 Received: (nullmailer pid 25052 invoked by uid 1000); Mon, 27 Jun 2016 20:43:07 -0000 From: David Bremner To: David Bremner , notmuch@notmuchmail.org Subject: [PATCH] lib: update cached mtime in notmuch_directory_set_mtime Date: Mon, 27 Jun 2016 22:43:04 +0200 Message-Id: <1467060184-25007-1-git-send-email-david@tethera.net> X-Mailer: git-send-email 2.8.1 In-Reply-To: <87k2hyxg5w.fsf@tesseract.cs.unb.ca> References: <87k2hyxg5w.fsf@tesseract.cs.unb.ca> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2016 20:43:20 -0000 Without this change, the following code fails notmuch_directory_set_mtime(dir, 12345); assert(notmuch_directory_get_mtime(dir) == 12345); --- lib/directory.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/directory.cc b/lib/directory.cc index a19f777..5de3319 100644 --- a/lib/directory.cc +++ b/lib/directory.cc @@ -227,6 +227,9 @@ notmuch_directory_set_mtime (notmuch_directory_t *directory, Xapian::sortable_serialise (mtime)); db->replace_document (directory->document_id, directory->doc); + + directory->mtime = mtime; + } catch (const Xapian::Error &error) { _notmuch_database_log (notmuch, "A Xapian exception occurred setting directory mtime: %s.\n", -- 2.8.1