chiark / gitweb /
sd-bus: assert clock_gettime()'s return value
authorDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 11:39:51 +0000 (13:39 +0200)
committerDaniel Mack <daniel@zonque.org>
Wed, 22 Oct 2014 11:39:51 +0000 (13:39 +0200)
Don't handle clock_gettime() errors gracefully but use assert_se().

src/libsystemd/sd-bus/bus-kernel.c

index 136c90fc6304a6597ed17407a87511d328a0c9d5..c23065edfeb397b1ba8ab9c7422132aece9b060a 100644 (file)
@@ -275,12 +275,7 @@ static int bus_message_setup_kmsg(sd_bus *b, sd_bus_message *m) {
         } else {
                 struct timespec now;
 
-                r = clock_gettime(CLOCK_MONOTONIC_COARSE, &now);
-                if (r < 0) {
-                        r = -errno;
-                        goto fail;
-                }
-
+                assert_se(clock_gettime(CLOCK_MONOTONIC_COARSE, &now) == 0);
                 m->kdbus->timeout_ns = now.tv_sec * NSEC_PER_SEC + now.tv_nsec +
                                        m->timeout * NSEC_PER_USEC;
         }