chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e73c78c
)
time: earlier exit from format_timestamp_relative() on special times
author
Lennart Poettering
<lennart@poettering.net>
Fri, 24 Oct 2014 17:08:22 +0000
(19:08 +0200)
committer
Lennart Poettering
<lennart@poettering.net>
Fri, 24 Oct 2014 17:08:22 +0000
(19:08 +0200)
src/shared/time-util.c
patch
|
blob
|
history
diff --git
a/src/shared/time-util.c
b/src/shared/time-util.c
index 4d34362bce5849829334c850e9a716d7b4ab595e..43ad9db91e5ce4114c4086487b84383267a8678c 100644
(file)
--- a/
src/shared/time-util.c
+++ b/
src/shared/time-util.c
@@
-219,11
+219,10
@@
char *format_timestamp_relative(char *buf, size_t l, usec_t t) {
const char *s;
usec_t n, d;
- n = now(CLOCK_REALTIME);
-
- if (t <= 0 || (t == USEC_INFINITY))
+ if (t <= 0 || t == USEC_INFINITY)
return NULL;
+ n = now(CLOCK_REALTIME);
if (n > t) {
d = n - t;
s = "ago";