summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-14 11:54:26 -0500
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-12-20 22:47:26 -0500
commit4d89874af6a798744a32deb314001a13a28f0559 (patch)
tree94b6c07a0aa096ebff644b7ec71f9f3fe057f87b /src/shared/time-util.c
parent3c547e6f8ef6bd37df1197862e1aca63d434cbff (diff)
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.
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index 678fd588b2..faa3418819 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;
}