summaryrefslogtreecommitdiff
path: root/vdr.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2002-12-13 14:31:17 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2002-12-13 14:31:17 +0100
commit2343e7ec141c85c0029d4b3fa6859e9f5335f81f (patch)
treeb3f61f2dddd624a15230a4d7cf03bd6f48528e37 /vdr.c
parent7d0596878b29feb9393f868ee881ab55b132114d (diff)
downloadvdr-2343e7ec141c85c0029d4b3fa6859e9f5335f81f.tar.gz
vdr-2343e7ec141c85c0029d4b3fa6859e9f5335f81f.tar.bz2
Fixed taking an active SVDRP connection into account when doing shutdown
Diffstat (limited to 'vdr.c')
-rw-r--r--vdr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/vdr.c b/vdr.c
index e253b792..b721cb36 100644
--- a/vdr.c
+++ b/vdr.c
@@ -22,7 +22,7 @@
*
* The project's page is at http://www.cadsoft.de/people/kls/vdr
*
- * $Id: vdr.c 1.138 2002/12/13 13:37:28 kls Exp $
+ * $Id: vdr.c 1.139 2002/12/13 14:30:00 kls Exp $
*/
#include <getopt.h>
@@ -424,6 +424,7 @@ int main(int argc, char *argv[])
time_t LastActivity = 0;
int MaxLatencyTime = 0;
bool ForceShutdown = false;
+ bool UserShutdown = false;
if (WatchdogTimeout > 0) {
dsyslog("setting watchdog timer to %d seconds", WatchdogTimeout);
@@ -539,6 +540,7 @@ int main(int argc, char *argv[])
ForceShutdown = true;
}
LastActivity = 1; // not 0, see below!
+ UserShutdown = true;
break;
default: break;
}
@@ -647,7 +649,7 @@ int main(int argc, char *argv[])
Interface->Info(tr("Editing process finished"));
}
}
- if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && !Interface->HasSVDRPConnection()) || ForceShutdown)) {
+ if (!Interact && ((!cRecordControls::Active() && !cCutter::Active() && (!Interface->HasSVDRPConnection() || UserShutdown)) || ForceShutdown)) {
time_t Now = time(NULL);
if (Now - LastActivity > ACTIVITYTIMEOUT) {
// Shutdown:
@@ -665,12 +667,13 @@ int main(int argc, char *argv[])
else
LastActivity = 1;
}
- bool UserShutdown = key == kPower;
if (UserShutdown && Next && Delta <= Setup.MinEventTimeout * 60 && !ForceShutdown) {
char *buf;
asprintf(&buf, tr("Recording in %d minutes, shut down anyway?"), Delta / 60);
if (Interface->Confirm(buf))
ForceShutdown = true;
+ else
+ UserShutdown = false;
free(buf);
}
if (!Next || Delta > Setup.MinEventTimeout * 60 || ForceShutdown) {
@@ -694,6 +697,7 @@ int main(int argc, char *argv[])
signal(SIGALRM, SIG_IGN);
}
LastActivity = time(NULL); // don't try again too soon
+ UserShutdown = false;
continue; // skip the rest of the housekeeping for now
}
}