unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails
@ 2011-11-06  5:34 David Riebenbauer
  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
  0 siblings, 2 replies; 3+ messages in thread
From: David Riebenbauer @ 2011-11-06  5:34 UTC (permalink / raw)
  To: Notmuch Mailing List

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-11-06  8:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-06  5:34 [PATCH 1/2] notmuch-deliver: Retry with readwrite if splice() fails David Riebenbauer
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

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).