[systemd-commits] 2 commits - Makefile-man.am src/shared

Zbigniew Jędrzejewski-Szmek zbyszek at kemper.freedesktop.org
Fri Dec 20 19:47:35 PST 2013


 Makefile-man.am        |    5 +++++
 src/shared/log.c       |    5 ++++-
 src/shared/time-util.c |    7 +++----
 3 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 4d89874af6a798744a32deb314001a13a28f0559
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Sat Dec 14 11:54:26 2013 -0500

    logging: reduce send timeout to something more sensible
    
    For a user, the timeout of 1 min per message seems equivalent to a hang.
    If journald cannot process a message from PID1 for 10 ms then something
    is significantly wrong. It's better to lose the message and continue.

diff --git a/src/shared/log.c b/src/shared/log.c
index b5b82f6..268f034 100644
--- a/src/shared/log.c
+++ b/src/shared/log.c
@@ -126,7 +126,10 @@ static int create_log_socket(int type) {
         /* We need a blocking fd here since we'd otherwise lose
         messages way too early. However, let's not hang forever in the
         unlikely case of a deadlock. */
-        timeval_store(&tv, 1*USEC_PER_MINUTE);
+        if (getpid() == 1)
+                timeval_store(&tv, 10 * USEC_PER_MSEC);
+        else
+                timeval_store(&tv, 10 * USEC_PER_SEC);
         setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &tv, sizeof(tv));
 
         return fd;
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 678fd58..faa3418 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -142,12 +142,11 @@ struct timeval *timeval_store(struct timeval *tv, usec_t u) {
         if (u == (usec_t) -1) {
                 tv->tv_sec = (time_t) -1;
                 tv->tv_usec = (suseconds_t) -1;
-                return tv;
+        } else {
+                tv->tv_sec = (time_t) (u / USEC_PER_SEC);
+                tv->tv_usec = (suseconds_t) (u % USEC_PER_SEC);
         }
 
-        tv->tv_sec = (time_t) (u / USEC_PER_SEC);
-        tv->tv_usec = (suseconds_t) (u % USEC_PER_SEC);
-
         return tv;
 }
 

commit 3c547e6f8ef6bd37df1197862e1aca63d434cbff
Author: Zbigniew Jędrzejewski-Szmek <zbyszek at in.waw.pl>
Date:   Fri Dec 20 20:26:08 2013 -0500

    build-sys: add sd_j_open_container manpage alias

diff --git a/Makefile-man.am b/Makefile-man.am
index 3811949..c5f73d4 100644
--- a/Makefile-man.am
+++ b/Makefile-man.am
@@ -156,6 +156,7 @@ MANPAGES_ALIAS += \
 	man/sd_journal_get_monotonic_usec.3 \
 	man/sd_journal_get_timeout.3 \
 	man/sd_journal_next_skip.3 \
+	man/sd_journal_open_container.3 \
 	man/sd_journal_open_directory.3 \
 	man/sd_journal_open_files.3 \
 	man/sd_journal_perror.3 \
@@ -258,6 +259,7 @@ man/sd_journal_get_events.3: man/sd_journal_get_fd.3
 man/sd_journal_get_monotonic_usec.3: man/sd_journal_get_realtime_usec.3
 man/sd_journal_get_timeout.3: man/sd_journal_get_fd.3
 man/sd_journal_next_skip.3: man/sd_journal_next.3
+man/sd_journal_open_container.3: man/sd_journal_open.3
 man/sd_journal_open_directory.3: man/sd_journal_open.3
 man/sd_journal_open_files.3: man/sd_journal_open.3
 man/sd_journal_perror.3: man/sd_journal_print.3
@@ -464,6 +466,9 @@ man/sd_journal_get_timeout.html: man/sd_journal_get_fd.html
 man/sd_journal_next_skip.html: man/sd_journal_next.html
 	$(html-alias)
 
+man/sd_journal_open_container.html: man/sd_journal_open.html
+	$(html-alias)
+
 man/sd_journal_open_directory.html: man/sd_journal_open.html
 	$(html-alias)
 



More information about the systemd-commits mailing list