`clock_nanosleep()` returns error codes directly, rather than using
`errno`. Ensure that we use those codes, rather than checking for `<0`.
if (usec == 0)
return 0;
- // FIXME: use RET_NERRNO() macro here. Currently, this header cannot include errno-util.h.
- return clock_nanosleep(CLOCK_MONOTONIC, 0, TIMESPEC_STORE(usec), NULL) < 0 ? -errno : 0;
+ /* `clock_nanosleep()` does not use `errno`, but returns positive error codes. */
+ return -clock_nanosleep(CLOCK_MONOTONIC, 0, TIMESPEC_STORE(usec), NULL);
}
/* The last second we can format is 31. Dec 9999, 1s before midnight, because otherwise we'd enter 5 digit