summaryrefslogtreecommitdiff
path: root/shutdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'shutdown.c')
-rw-r--r--shutdown.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/shutdown.c b/shutdown.c
index 4029a78..4fde544 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.1 2007/02/24 17:24:11 kls Exp $
+ * $Id: shutdown.c 1.2 2007/10/19 14:33:40 kls Exp $
*/
#include "shutdown.h"
@@ -110,9 +110,11 @@ void cShutdownHandler::CheckManualStart(int ManualStart)
// Set inactive after MinUserInactivity
SetUserInactiveTimeout();
}
- else
+ else {
// Set inactive from now on
+ dsyslog("scheduled wakeup time in %ld minutes, assuming automatic start of VDR", Delta / 60);
SetUserInactive();
+ }
}
void cShutdownHandler::SetShutdownCommand(const char *ShutdownCommand)
@@ -126,8 +128,13 @@ void cShutdownHandler::CallShutdownCommand(time_t WakeupTime, int Channel, const
time_t Delta = WakeupTime ? WakeupTime - time(NULL) : 0;
cString cmd = cString::sprintf("%s %ld %ld %d \"%s\" %d", shutdownCommand, WakeupTime, Delta, Channel, *strescape(File, "\"$"), UserShutdown);
isyslog("executing '%s'", *cmd);
- if (SystemExec(cmd, true) == 0)
+ int Status = SystemExec(cmd, true);
+ if (!WIFEXITED(Status) || WEXITSTATUS(Status))
+ esyslog("SystemExec() failed with status %d", Status);
+ else {
Setup.NextWakeupTime = WakeupTime; // Remember this wakeup time for comparison on reboot
+ Setup.Save();
+ }
}
void cShutdownHandler::SetUserInactiveTimeout(int Seconds, bool Force)