[PATCH 2/2] notmuch-deliver: in save_splice() log failures as debug.

David Riebenbauer davrieb at liegesta.at
Sat Nov 5 22:34:28 PDT 2011


If we don't exit if splice fails then we should just log failures as
debug instead of critical.
---
 contrib/notmuch-deliver/src/main.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/contrib/notmuch-deliver/src/main.c b/contrib/notmuch-deliver/src/main.c
index 8423d91..39cd804 100644
--- a/contrib/notmuch-deliver/src/main.c
+++ b/contrib/notmuch-deliver/src/main.c
@@ -148,7 +148,7 @@ save_splice(int fdin, int fdout)
 	int ret, written, pfd[2];
 
 	if (pipe(pfd) < 0) {
-		g_critical("Failed to create pipe: %s", g_strerror(errno));
+		g_debug("Failed to create pipe: %s", g_strerror(errno));
 		return EX_IOERR;
 	}
 
@@ -157,7 +157,7 @@ save_splice(int fdin, int fdout)
 		if (!ret)
 			break;
 		if (ret < 0) {
-			g_critical("Splicing data from standard input failed: %s",
+			g_debug("Splicing data from standard input failed: %s",
 				g_strerror(errno));
 			close(pfd[0]);
 			close(pfd[1]);
@@ -167,13 +167,13 @@ save_splice(int fdin, int fdout)
 		do {
 			written = splice(pfd[0], NULL, fdout, NULL, ret, 0);
 			if (!written) {
-				g_critical("Splicing data to temporary file failed: internal error");
+				g_debug("Splicing data to temporary file failed: internal error");
 				close(pfd[0]);
 				close(pfd[1]);
 				return EX_IOERR;
 			}
 			if (written < 0) {
-				g_critical("Splicing data to temporary file failed: %s",
+				g_debug("Splicing data to temporary file failed: %s",
 					g_strerror(errno));
 				close(pfd[0]);
 				close(pfd[1]);
-- 
1.7.7.1



More information about the notmuch mailing list