diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-19 10:41:30 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-10-19 10:41:30 +0300 |
commit | c82b7d90fdf12cadb29dcfe177c5638c04ed544c (patch) | |
tree | f4925a1a86a72c17efd0affa9b8167b6411abe45 /src/progman.c | |
parent | 4cb33c7c355491f602bbf09f97e90aa90afb4797 (diff) | |
download | pies-c82b7d90fdf12cadb29dcfe177c5638c04ed544c.tar.gz pies-c82b7d90fdf12cadb29dcfe177c5638c04ed544c.tar.bz2 |
Account for possible system clock inaccuracies.
* src/pies.h (progman_wake_sleeping): Takes one argument.
* src/progman.c (progman_wake_sleeping): Takes one argument.
Account for possible clock inaccuracy.
(progman_cleanup): Print correct signal number in the diagnostics.
Update call to progman_wake_sleeping.
* src/pies.c (main): Update call to progman_wake_sleeping.
Diffstat (limited to 'src/progman.c')
-rw-r--r-- | src/progman.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/progman.c b/src/progman.c index 5085f16..570e31e 100644 --- a/src/progman.c +++ b/src/progman.c @@ -1119,7 +1119,7 @@ check_stopping (struct prog *prog, time_t now) } void -progman_wake_sleeping () +progman_wake_sleeping (int onalrm) { struct prog *prog; time_t now = time (NULL); @@ -1139,6 +1139,10 @@ progman_wake_sleeping () prog->v.p.timestamp = 0; prog_start (prog); } + /* If there is no alarm pending, recompute next alarm. + This allows to cope with eventual clock inaccuracies. */ + if (onalrm) + recompute_alarm = 1; break; case status_stopping: @@ -1656,9 +1660,10 @@ progman_cleanup (int expect_term) } else if (WIFSIGNALED (status)) { - retcode = STATUS_SIG_BIT | WTERMSIG (status); + retcode = WTERMSIG (status); debug (1, (_("%s: terminated on signal %d"), prog->tag, retcode)); + retcode |= STATUS_SIG_BIT; } else { @@ -1710,7 +1715,7 @@ progman_cleanup (int expect_term) if (!expect_term) /* This will also recompute alarm settings, if necessary */ - progman_wake_sleeping (); + progman_wake_sleeping (0); } void |