Skip to content

Commit

Permalink
Add more debug messages for device add and init
Browse files Browse the repository at this point in the history
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Jan 2, 2024
1 parent 578cbf9 commit 2e157cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,8 +657,11 @@ int wdt_init(uev_ctx_t *ctx, const char *name)

if (name) {
/* Check if already in .conf file */
if (!find(name))
if (!find(name)) {
DEBUG("Adding command line device %s, interval %d, timeout %d, safe-exit %d",
name, period, timeout, magic);
wdt_add(name, period, timeout, magic, 1);
}
}

TAILQ_FOREACH(dev, &devices, link) {
Expand Down Expand Up @@ -694,6 +697,7 @@ int wdt_init(uev_ctx_t *ctx, const char *name)

/* If user did not provide '-t' interval, set to half WDT timeout */
if (!dev->interval) {
DEBUG("Missing interval, calculating: %d / 2", dev->timeout);
dev->interval = dev->timeout / 2;
if (!dev->interval)
dev->interval = 1;
Expand Down

0 comments on commit 2e157cd

Please sign in to comment.