All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] gnutv: exit on EPIPE/SIGPIPE
@ 2012-05-07 11:15 Brian J. Murrell
  0 siblings, 0 replies; only message in thread
From: Brian J. Murrell @ 2012-05-07 11:15 UTC (permalink / raw)
  To: linux-media

[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]

When using gnutv with "-out stdout" it doesn't exit when it's reader
quits (i.e. and it gets an EPIPE/SIGPIPE).

Signed-off-by: Brian J. Murrell <brian@interlinx.bc.ca>
---
--- linuxtv-dvb-apps-1.1.1+rev1273~/util/gnutv/gnutv_data.c	2011-11-28 09:10:33.010407011 -0500
+++ linuxtv-dvb-apps-1.1.1+rev1273/util/gnutv/gnutv_data.c	2011-11-28 09:10:26.446258282 -0500
@@ -265,7 +265,10 @@
 		while(written < size) {
 			int tmp = write(outfd, buf + written, size - written);
 			if (tmp == -1) {
-				if (errno != EINTR) {
+				if (errno == EPIPE) {
+					fprintf(stderr, "processing EPIPE\n");
+					return 0;
+				} else if (errno != EINTR) {
 					fprintf(stderr, "Write error: %m\n");
 					break;
 				}
--- linuxtv-dvb-apps-1.1.1+rev1273~/util/gnutv/gnutv.c	2011-11-28 10:13:13.294445131 -0500
+++ linuxtv-dvb-apps-1.1.1+rev1273/util/gnutv/gnutv.c.new	2011-11-28 10:13:10.510492321 -0500
@@ -262,7 +262,7 @@
 
 	// setup any signals
 	signal(SIGINT, signal_handler);
-	signal(SIGPIPE, SIG_IGN);
+	signal(SIGPIPE, signal_handler);
 
 	// start the CA stuff
 	gnutv_ca_params.adapter_id = adapter_id;


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 262 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2012-05-07 11:15 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-07 11:15 [PATCH 1/1] gnutv: exit on EPIPE/SIGPIPE Brian J. Murrell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.