diff options
author | Simon Rettberg | 2019-05-23 13:33:05 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-05-23 13:33:05 +0200 |
commit | bd57a22c8bebdd012faf393c819c8f8888e152eb (patch) | |
tree | 1cdc48a0367140c20ef8b20f44878b8ca52b1800 | |
parent | Refine timings (diff) | |
download | idle-daemon-bd57a22c8bebdd012faf393c819c8f8888e152eb.tar.gz idle-daemon-bd57a22c8bebdd012faf393c819c8f8888e152eb.tar.xz idle-daemon-bd57a22c8bebdd012faf393c819c8f8888e152eb.zip |
Make sure user promptly sees warning when using RPC
-rw-r--r-- | src/main.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -279,17 +279,18 @@ int main( int argc, char **argv ) } CAP_SLEEP( remaining - ( ( remaining - 30 ) / 60 * 60 + 2 ) ); } else { - CAP_SLEEP( remaining - 299 ); + CAP_SLEEP( remaining - 305 ); } } } do { + const time_t oldDeadline = nextAction.deadline; // Handle requests rpcHandle( listenFd ); // Might have set a new scheduled action - if ( nextAction.deadline != 0 && nextAction.force ) { + if ( nextAction.deadline != oldDeadline ) { int delta = nextAction.deadline - monoNOW; - CAP_SLEEP( delta ); + CAP_SLEEP( delta - 305 ); } // Sleep until next run //printf( "Sleeping %d seconds\n ", sleepTime ); |