summaryrefslogtreecommitdiff
path: root/shutdown.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2013-02-18 10:41:43 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2013-02-18 10:41:43 +0100
commiteda593934db9ccb1c67d566ecf13108672c08ab6 (patch)
tree30e5c952c0899853b78cea862cb0d73314337630 /shutdown.c
parenta88ca5d4e5e3f994b74411a6f8089730109f9bcf (diff)
downloadvdr-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.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/shutdown.c b/shutdown.c
index d71a3a13..445ed6f2 100644
--- a/shutdown.c
+++ b/shutdown.c
@@ -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)