diff options
author | Klaus Schmidinger <vdr@tvdr.de> | 2001-06-02 10:47:40 +0200 |
---|---|---|
committer | Klaus Schmidinger <vdr@tvdr.de> | 2001-06-02 10:47:40 +0200 |
commit | c40e4eb96e43963845d1de1678a317b27e77f04e (patch) | |
tree | fc61866ba83db4bb0611cb45f1bd951eeeb56bd7 /vdr.c | |
parent | 1ef2b1d3a149348539565902825bb168a52673a1 (diff) | |
download | vdr-c40e4eb96e43963845d1de1678a317b27e77f04e.tar.gz vdr-c40e4eb96e43963845d1de1678a317b27e77f04e.tar.bz2 |
Converted to the new API plus several small enhancements0.8.0
Diffstat (limited to 'vdr.c')
-rw-r--r-- | vdr.c | 14 |
1 files changed, 12 insertions, 2 deletions
@@ -22,7 +22,7 @@ * * The project's page is at http://www.cadsoft.de/people/kls/vdr * - * $Id: vdr.c 1.56 2001/04/01 11:16:54 kls Exp $ + * $Id: vdr.c 1.57 2001/05/25 09:31:09 kls Exp $ */ #include <getopt.h> @@ -267,6 +267,11 @@ int main(int argc, char *argv[]) } while (!Interrupted) { + // Handle emergency exits: + if (cThread::EmergencyExit()) { + esyslog(LOG_ERR, "emergency exit requested - shutting down"); + break; + } // Restart the Watchdog timer: if (WatchdogTimeout > 0) { int LatencyTime = WatchdogTimeout - alarm(WatchdogTimeout); @@ -388,7 +393,8 @@ int main(int argc, char *argv[]) else LastActivity = time(NULL); } - isyslog(LOG_INFO, "caught signal %d", Interrupted); + if (Interrupted) + isyslog(LOG_INFO, "caught signal %d", Interrupted); Setup.CurrentChannel = cDvbApi::CurrentChannel(); Setup.Save(); cVideoCutter::Stop(); @@ -401,5 +407,9 @@ int main(int argc, char *argv[]) isyslog(LOG_INFO, "exiting"); if (SysLogLevel > 0) closelog(); + if (cThread::EmergencyExit()) { + esyslog(LOG_ERR, "emergency exit!"); + return 1; + } return 0; } |