diff options
author | Eduardo Chappa <chappa@washington.edu> | 2019-01-01 14:25:22 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2019-01-01 14:25:22 -0700 |
commit | 2e921f97bd1278a800acadcea21dbf7bf58ea51c (patch) | |
tree | d40e99180c6e35da06fd85b05eb8a460eedff78c /alpine/status.c | |
parent | 69950995bed9305ebc6dabab64f017b544bc8f1e (diff) | |
download | alpine-2e921f97bd1278a800acadcea21dbf7bf58ea51c.tar.xz |
* When there are time changes in the clock, Alpine might go to sleep
for big amounts of time while displaying messages in the screen.
Reset sleep time to 5 seconds in case it finds it needs to sleep
more than 5 seconds or a negative amount of time.
Diffstat (limited to 'alpine/status.c')
-rw-r--r-- | alpine/status.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/alpine/status.c b/alpine/status.c index 1c5d3595..fcfcdfda 100644 --- a/alpine/status.c +++ b/alpine/status.c @@ -229,6 +229,15 @@ pause_for_and_dq_cur_msg(void) if((w = status_message_remaining_nolock()) != 0){ delay_cmd_cue(1); + /* protect user from changes in the clock. If the clock + * changes during this process (for example, going from + * Standard time to Delayed time) this may result in big + * values for w. In those cases, reset w. + */ + if(w < 0 || w > 5){ /* maximum wait time is 5 seconds */ + w = 5; + displayed_time = time(0); + } sleep(w); delay_cmd_cue(0); } |