chiark / gitweb /
bus: add new sd_bus_creds object to encapsulate process credentials
[elogind.git] / src / shared / time-util.c
index b29d8c6e4ee710cbba2e3e4512786001ea7c2eb6..55428c4ced93cd9a6a5ae37f37d56137c5053c71 100644 (file)
@@ -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);