Merge pull request #22600 from poettering/timestamp_is_set-more
make more use of timestamp_is_set()
This commit is contained in:
@@ -641,7 +641,7 @@ _public_ int sd_watchdog_enabled(int unset_environment, uint64_t *usec) {
|
||||
r = safe_atou64(s, &u);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
if (u <= 0 || u >= USEC_INFINITY) {
|
||||
if (!timestamp_is_set(u)) {
|
||||
r = -EINVAL;
|
||||
goto finish;
|
||||
}
|
||||
|
||||
@@ -64,15 +64,15 @@ static void patch_realtime(
|
||||
assert(realtime);
|
||||
|
||||
x = timespec_load(&st->st_ctim);
|
||||
if (x > 0 && x != USEC_INFINITY && x < *realtime)
|
||||
if (timestamp_is_set(x) && x < *realtime)
|
||||
*realtime = x;
|
||||
|
||||
x = timespec_load(&st->st_atim);
|
||||
if (x > 0 && x != USEC_INFINITY && x < *realtime)
|
||||
if (timestamp_is_set(x) && x < *realtime)
|
||||
*realtime = x;
|
||||
|
||||
x = timespec_load(&st->st_mtim);
|
||||
if (x > 0 && x != USEC_INFINITY && x < *realtime)
|
||||
if (timestamp_is_set(x) && x < *realtime)
|
||||
*realtime = x;
|
||||
|
||||
/* Let's read the original creation time, if possible. Ideally we'd just query the creation time the
|
||||
|
||||
Reference in New Issue
Block a user