From: David Riebenbauer <davrieb@liegesta.at>
To: Notmuch Mailing List <notmuch@notmuchmail.org>
Subject: [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails
Date: Sun, 6 Nov 2011 06:34:27 +0100 [thread overview]
Message-ID: <1320557668-2314-1-git-send-email-davrieb@liegesta.at> (raw)
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
next reply other threads:[~2011-11-06 5:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-06 5:34 David Riebenbauer [this message]
2011-11-06 5:34 ` [PATCH 2/2] notmuch-deliver: in save_splice() log failures as debug David Riebenbauer
2011-11-06 8:01 ` [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails Ali Polatel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1320557668-2314-1-git-send-email-davrieb@liegesta.at \
--to=davrieb@liegesta.at \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).