journal: silently skip failing large messages if journald is missing
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Dec 2015 07:44:50 +0000 (02:44 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Dec 2015 16:44:59 +0000 (11:44 -0500)
We treated -ENOENT errors with silent failure, for small messages.
Do the same for large messages.

src/journal/journal-send.c

index adb3af0..44fa11a 100644 (file)
@@ -337,7 +337,11 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
                         return r;
         }
 
-        return send_one_fd_sa(fd, buffer_fd, mh.msg_name, mh.msg_namelen, 0);
+        r = send_one_fd_sa(fd, buffer_fd, mh.msg_name, mh.msg_namelen, 0);
+        if (r == -ENOENT)
+                /* Fail silently if the journal is not available */
+                return 0;
+        return r;
 }
 
 static int fill_iovec_perror_and_send(const char *message, int skip, struct iovec iov[]) {