Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id B501F429E27 for ; Sat, 5 Nov 2011 22:34:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ojUjUN0bkdEX for ; Sat, 5 Nov 2011 22:34:47 -0700 (PDT) Received: from plum.liegesta.at (plum.liegesta.at [83.169.17.237]) by olra.theworths.org (Postfix) with ESMTP id 13CCF429E21 for ; Sat, 5 Nov 2011 22:34:47 -0700 (PDT) Received: from ambiguous-mid.liegesta.at (mk046207255003.a1.net [46.207.255.3]) (Authenticated sender: davrieb) by plum.liegesta.at (Postfix) with ESMTPA id 0B95227B8230; Sun, 6 Nov 2011 06:34:45 +0100 (CET) Received: by ambiguous-mid.liegesta.at (Postfix, from userid 1000) id 67A0F20077; Sun, 6 Nov 2011 06:34:39 +0100 (CET) From: David Riebenbauer To: Notmuch Mailing List Subject: [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails Date: Sun, 6 Nov 2011 06:34:27 +0100 Message-Id: <1320557668-2314-1-git-send-email-davrieb@liegesta.at> X-Mailer: git-send-email 1.7.7.1 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 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: Sun, 06 Nov 2011 05:34:47 -0000 notmuch-deliver should not just fail, when splice() doesn't work. Fall back to the readwrite method even if NOTMUCH_DELIVER_NO_SPLICE is not set. --- contrib/notmuch-deliver/src/main.c | 10 +++++++--- 1 files changed, 7 insertions(+), 3 deletions(-) diff --git a/contrib/notmuch-deliver/src/main.c b/contrib/notmuch-deliver/src/main.c index f7a4eaa..8423d91 100644 --- a/contrib/notmuch-deliver/src/main.c +++ b/contrib/notmuch-deliver/src/main.c @@ -252,9 +252,13 @@ save_maildir(int fdin, const char *dir, int auto_create, char **path) g_debug("Reading from standard input and writing to `%s'", info.tmpname); #ifdef HAVE_SPLICE - ret = g_getenv("NOTMUCH_DELIVER_NO_SPLICE") - ? save_readwrite(fdin, fdout) - : save_splice(fdin, fdout); + if (g_getenv("NOTMUCH_DELIVER_NO_SPLICE")) + ret = save_readwrite(fdin, fdout); + else { + ret = save_splice(fdin, fdout); + if (ret) + ret = save_readwrite(fdin, fdout); + } #else ret = save_readwrite(fdin, fdout); #endif /* HAVE_SPLICE */ -- 1.7.7.1