Re: [PATCH] new: Don't scan unchanged directories with no sub-directories
[notmuch-archives.git] / 29 / df8999757a64bb6086b2a4de505cb672a562a8
1 Return-Path: <davrieb@liegesta.at>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id B501F429E27\r
6         for <notmuch@notmuchmail.org>; Sat,  5 Nov 2011 22:34:47 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id ojUjUN0bkdEX for <notmuch@notmuchmail.org>;\r
16         Sat,  5 Nov 2011 22:34:47 -0700 (PDT)\r
17 Received: from plum.liegesta.at (plum.liegesta.at [83.169.17.237])\r
18         by olra.theworths.org (Postfix) with ESMTP id 13CCF429E21\r
19         for <notmuch@notmuchmail.org>; Sat,  5 Nov 2011 22:34:47 -0700 (PDT)\r
20 Received: from ambiguous-mid.liegesta.at (mk046207255003.a1.net\r
21  [46.207.255.3])        (Authenticated sender: davrieb) by plum.liegesta.at (Postfix)\r
22  with ESMTPA id 0B95227B8230;   Sun,  6 Nov 2011 06:34:45 +0100 (CET)\r
23 Received: by ambiguous-mid.liegesta.at (Postfix, from userid 1000)\r
24         id 67A0F20077; Sun,  6 Nov 2011 06:34:39 +0100 (CET)\r
25 From: David Riebenbauer <davrieb@liegesta.at>\r
26 To: Notmuch Mailing List <notmuch@notmuchmail.org>\r
27 Subject: [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails\r
28 Date: Sun,  6 Nov 2011 06:34:27 +0100\r
29 Message-Id: <1320557668-2314-1-git-send-email-davrieb@liegesta.at>\r
30 X-Mailer: git-send-email 1.7.7.1\r
31 X-BeenThere: notmuch@notmuchmail.org\r
32 X-Mailman-Version: 2.1.13\r
33 Precedence: list\r
34 List-Id: "Use and development of the notmuch mail system."\r
35         <notmuch.notmuchmail.org>\r
36 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
37         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
38 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
39 List-Post: <mailto:notmuch@notmuchmail.org>\r
40 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
41 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
42         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
43 X-List-Received-Date: Sun, 06 Nov 2011 05:34:47 -0000\r
44 \r
45 notmuch-deliver should not just fail, when splice() doesn't work. Fall\r
46 back to the readwrite method even if NOTMUCH_DELIVER_NO_SPLICE is not\r
47 set.\r
48 ---\r
49  contrib/notmuch-deliver/src/main.c |   10 +++++++---\r
50  1 files changed, 7 insertions(+), 3 deletions(-)\r
51 \r
52 diff --git a/contrib/notmuch-deliver/src/main.c b/contrib/notmuch-deliver/src/main.c\r
53 index f7a4eaa..8423d91 100644\r
54 --- a/contrib/notmuch-deliver/src/main.c\r
55 +++ b/contrib/notmuch-deliver/src/main.c\r
56 @@ -252,9 +252,13 @@ save_maildir(int fdin, const char *dir, int auto_create, char **path)\r
57  \r
58         g_debug("Reading from standard input and writing to `%s'", info.tmpname);\r
59  #ifdef HAVE_SPLICE\r
60 -       ret = g_getenv("NOTMUCH_DELIVER_NO_SPLICE")\r
61 -               ? save_readwrite(fdin, fdout)\r
62 -               : save_splice(fdin, fdout);\r
63 +       if (g_getenv("NOTMUCH_DELIVER_NO_SPLICE"))\r
64 +               ret = save_readwrite(fdin, fdout);\r
65 +       else {\r
66 +               ret = save_splice(fdin, fdout);\r
67 +               if (ret)\r
68 +                       ret = save_readwrite(fdin, fdout);\r
69 +       }\r
70  #else\r
71         ret = save_readwrite(fdin, fdout);\r
72  #endif /* HAVE_SPLICE */\r
73 -- \r
74 1.7.7.1\r
75 \r