mirror of
https://github.com/systemd/systemd
synced 2024-10-15 04:24:19 +00:00
test-watchdog: use watchdog_runtime_wait() to determine sleep interval
As sugggested in https://github.com/systemd/systemd/issues/22001#issuecomment-1006755438.
This commit is contained in:
parent
cd933f14bd
commit
788c2d9523
|
@ -27,12 +27,13 @@ int main(int argc, char *argv[]) {
|
|||
t = 0;
|
||||
|
||||
for (i = 0; i < count; i++) {
|
||||
t = watchdog_runtime_wait();
|
||||
log_info("Sleeping " USEC_FMT " microseconds...", t);
|
||||
usleep(t);
|
||||
log_info("Pinging...");
|
||||
r = watchdog_ping();
|
||||
if (r < 0)
|
||||
log_warning_errno(r, "Failed to ping watchdog: %m");
|
||||
|
||||
usleep(t/2);
|
||||
}
|
||||
|
||||
watchdog_close(true);
|
||||
|
|
Loading…
Reference in a new issue