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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user