[systemd-commits] src/journal

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Tue Dec 3 09:11:57 PST 2013


 src/journal/journal-send.c |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 6c045c0b4c49c88a1d3b9360c05efa5084796d2d
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Tue Dec 3 08:07:32 2013 -0500

    journal: fail silently in sd_j_sendv() if journal is unavailable
    
    "syslog(3) and sd_journal_print() may largely be used interchangeably
    functionality-wise" according to sd_journal_print(3). This socket
    should be always available except in rare circumstatances, and we
    don't random applications to fail on logging, so let's do what syslog
    did. The alternative of forcing all callers to do error handling for
    this rare case doesn't really have any benefits, since if they can't
    log there isn't much they can do anyway.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1023041

diff --git a/src/journal/journal-send.c b/src/journal/journal-send.c
index 931c1e7..281e154 100644
--- a/src/journal/journal-send.c
+++ b/src/journal/journal-send.c
@@ -300,6 +300,10 @@ _public_ int sd_journal_sendv(const struct iovec *iov, int n) {
         if (k >= 0)
                 return 0;
 
+        /* Fail silently if the journal is not available */
+        if (errno == ENOENT)
+                return 0;
+
         if (errno != EMSGSIZE && errno != ENOBUFS)
                 return -errno;
 



More information about the systemd-commits mailing list