summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-09-15 13:58:36 +0200
committerKlaus Schmidinger <vdr@tvdr.de>2000-09-15 13:58:36 +0200
commit39600857613d85e035ab1f93ad8360d9eaf00fe0 (patch)
treeee1523c4a4f4e2096a25150f2302f7081968e7c2
parent5c6d5f5316bf625b66d2592bd335de33b54cfed1 (diff)
downloadvdr-39600857613d85e035ab1f93ad8360d9eaf00fe0.tar.gz
vdr-39600857613d85e035ab1f93ad8360d9eaf00fe0.tar.bz2
Handling SIGPIPE and re-establishing handler after intercepting a signal
-rw-r--r--HISTORY1
-rw-r--r--vdr.c9
2 files changed, 7 insertions, 3 deletions
diff --git a/HISTORY b/HISTORY
index 7c888758..35aa7aa4 100644
--- a/HISTORY
+++ b/HISTORY
@@ -172,3 +172,4 @@ Video Disk Recorder Revision History
- Video files now have the 'group read' bit set.
- Fixed handling errors in 'readstring()'.
+- Handling SIGPIPE and re-establishing handler after intercepting a signal.
diff --git a/vdr.c b/vdr.c
index 4932bf23..26c3693a 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.30 2000/09/10 14:33:09 kls Exp $
+ * $Id: vdr.c 1.31 2000/09/15 13:55:39 kls Exp $
*/
#include <getopt.h>
@@ -46,9 +46,11 @@
static int Interrupted = 0;
-void SignalHandler(int signum)
+static void SignalHandler(int signum)
{
- Interrupted = signum;
+ if (signum != SIGPIPE)
+ Interrupted = signum;
+ signal(signum, SignalHandler);
}
int main(int argc, char *argv[])
@@ -174,6 +176,7 @@ int main(int argc, char *argv[])
if (signal(SIGHUP, SignalHandler) == SIG_IGN) signal(SIGHUP, SIG_IGN);
if (signal(SIGINT, SignalHandler) == SIG_IGN) signal(SIGINT, SIG_IGN);
if (signal(SIGTERM, SignalHandler) == SIG_IGN) signal(SIGTERM, SIG_IGN);
+ if (signal(SIGPIPE, SignalHandler) == SIG_IGN) signal(SIGPIPE, SIG_IGN);
// Main program loop: