From 52bb308c138dd1006078370c93e0e77dfc61de73 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 18 Mar 2022 14:19:20 +0100 Subject: time-util: add macros around timespec_store() that operates on compund literal allocated timespec struct This way we can convert usec_t to timespec on-the-fly, without a buffer. No actual behaviour change just some shortening of code. --- src/nspawn/nspawn-stub-pid1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/nspawn/nspawn-stub-pid1.c') diff --git a/src/nspawn/nspawn-stub-pid1.c b/src/nspawn/nspawn-stub-pid1.c index 6dbd6ba4c9..85c439815c 100644 --- a/src/nspawn/nspawn-stub-pid1.c +++ b/src/nspawn/nspawn-stub-pid1.c @@ -142,10 +142,8 @@ int stub_pid1(sd_id128_t uuid) { if (quit_usec == USEC_INFINITY) r = sigwaitinfo(&waitmask, &si); - else { - struct timespec ts; - r = sigtimedwait(&waitmask, &si, timespec_store(&ts, quit_usec - current_usec)); - } + else + r = sigtimedwait(&waitmask, &si, TIMESPEC_STORE(quit_usec - current_usec)); if (r < 0) { if (errno == EINTR) /* strace -p attach can result in EINTR, let's handle this nicely. */ continue; -- cgit v1.2.1