diff options
author | Lennart Poettering <lennart@poettering.net> | 2012-04-13 21:33:28 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2012-04-13 21:37:59 +0200 |
commit | c757a65b6afb462bde082b5362bbb5a074b5bb7b (patch) | |
tree | 418574d4844ca800499f23d01b285b2b72e18f81 /src/core/manager.c | |
parent | d4e7373bbbc878b0d8ed1c28e21262a6d908d616 (diff) |
watchdog: make watchdog dbus properties writable
Diffstat (limited to 'src/core/manager.c')
-rw-r--r-- | src/core/manager.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/core/manager.c b/src/core/manager.c index 1d32adff6d..c8ac29be5b 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -2457,7 +2457,6 @@ static int process_event(Manager *m, struct epoll_event *ev) { int manager_loop(Manager *m) { int r; - int wait_msec = -1; RATELIMIT_DEFINE(rl, 1*USEC_PER_SEC, 50000); @@ -2476,18 +2475,12 @@ int manager_loop(Manager *m) { if (r < 0) return r; - /* Sleep for half the watchdog time */ - if (m->runtime_watchdog > 0 && m->running_as == MANAGER_SYSTEM) { - wait_msec = (int) (m->runtime_watchdog / 2 / USEC_PER_MSEC); - if (wait_msec <= 0) - wait_msec = 1; - } - while (m->exit_code == MANAGER_RUNNING) { struct epoll_event event; int n; + int wait_msec = -1; - if (wait_msec >= 0) + if (m->runtime_watchdog > 0 && m->running_as == MANAGER_SYSTEM) watchdog_ping(); if (!ratelimit_test(&rl)) { @@ -2518,6 +2511,14 @@ int manager_loop(Manager *m) { if (swap_dispatch_reload(m) > 0) continue; + /* Sleep for half the watchdog time */ + if (m->runtime_watchdog > 0 && m->running_as == MANAGER_SYSTEM) { + wait_msec = (int) (m->runtime_watchdog / 2 / USEC_PER_MSEC); + if (wait_msec <= 0) + wait_msec = 1; + } else + wait_msec = -1; + n = epoll_wait(m->epoll_fd, &event, 1, wait_msec); if (n < 0) { |