X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Ftime-util.h;h=fca8a4db9b85324c1d9329daef58f0b15d12b9a0;hb=320814811417146cfa1e416f69f1101eed630c36;hp=b55a660bb006c140d5387d95c27bee8b603a22d2;hpb=e4746b57387ffaf8be01c177ed4bbf02c8088341;p=elogind.git diff --git a/src/shared/time-util.h b/src/shared/time-util.h index b55a660bb..fca8a4db9 100644 --- a/src/shared/time-util.h +++ b/src/shared/time-util.h @@ -67,7 +67,7 @@ typedef struct dual_timestamp { #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1) -#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0, 0 }) +#define DUAL_TIMESTAMP_NULL ((struct dual_timestamp) { 0ULL, 0ULL }) usec_t now(clockid_t clock); @@ -107,3 +107,5 @@ int get_timezones(char ***l); bool timezone_is_valid(const char *name); clockid_t clock_boottime_or_monotonic(void); + +#define xstrftime(buf, fmt, tm) assert_se(strftime(buf, ELEMENTSOF(buf), fmt, tm) > 0)