summaryrefslogtreecommitdiff
path: root/src/shared/time-util.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-11 03:03:17 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-11 15:54:42 +0100
commit966204e010ed432a1d7a0481d41a326d8ec7b0c8 (patch)
tree8948c584db95024236f799de2daa23930816ad86 /src/shared/time-util.c
parent1fcf71f562a83a59f853f982306fca7d009bb30d (diff)
timer: consider (usec_t) -1 an invalid timestamp
Diffstat (limited to 'src/shared/time-util.c')
-rw-r--r--src/shared/time-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/shared/time-util.c b/src/shared/time-util.c
index b29d8c6e4e..55428c4ced 100644
--- a/src/shared/time-util.c
+++ b/src/shared/time-util.c
@@ -158,7 +158,7 @@ char *format_timestamp(char *buf, size_t l, usec_t t) {
assert(buf);
assert(l > 0);
- if (t <= 0)
+ if (t <= 0 || t == (usec_t) -1)
return NULL;
sec = (time_t) (t / USEC_PER_SEC);
@@ -176,7 +176,7 @@ char *format_timestamp_us(char *buf, size_t l, usec_t t) {
assert(buf);
assert(l > 0);
- if (t <= 0)
+ if (t <= 0 || t == (usec_t) -1)
return NULL;
sec = (time_t) (t / USEC_PER_SEC);