diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2013-02-18 10:41:43 +0100 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2013-02-18 10:41:43 +0100 |
commit | eda593934db9ccb1c67d566ecf13108672c08ab6 (patch) | |
tree | 30e5c952c0899853b78cea862cb0d73314337630 /shutdown.c | |
parent | a88ca5d4e5e3f994b74411a6f8089730109f9bcf (diff) | |
download | vdr-eda593934db9ccb1c67d566ecf13108672c08ab6.tar.gz vdr-eda593934db9ccb1c67d566ecf13108672c08ab6.tar.bz2 |
Modified handling user inactivity in the shutdown handler to avoid a problem in case the system time is changed after VDR has been started
Diffstat (limited to 'shutdown.c')
-rw-r--r-- | shutdown.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -6,7 +6,7 @@ * * Original version written by Udo Richter <udo_richter@gmx.de>. * - * $Id: shutdown.c 1.5 2008/02/24 10:29:00 kls Exp $ + * $Id: shutdown.c 2.1 2013/02/18 10:33:26 kls Exp $ */ #include "shutdown.h" @@ -117,7 +117,7 @@ void cShutdownHandler::CheckManualStart(int ManualStart) else { // Set inactive from now on dsyslog("scheduled wakeup time in %ld minutes, assuming automatic start of VDR", Delta / 60); - SetUserInactive(); + SetUserInactiveTimeout(-3, true); } } @@ -147,9 +147,14 @@ void cShutdownHandler::SetUserInactiveTimeout(int Seconds, bool Force) activeTimeout = 0; return; } - if (Seconds < 0) - Seconds = Setup.MinUserInactivity * 60; - activeTimeout = time(NULL) + Seconds; + if (Seconds >= 0) + activeTimeout = time(NULL) + Seconds; + else if (Seconds == -1) + activeTimeout = time(NULL) + Setup.MinUserInactivity * 60; + else if (Seconds == -2) + activeTimeout = 0; + else if (Seconds == -3) + activeTimeout = 1; } bool cShutdownHandler::ConfirmShutdown(bool Interactive) |