[v4l-utils PATCH-v2 2/4] dvbv5-zap.c: allow timeout with -x

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Timeout handlers aren't set when running with -x (exit after tuning).
This patch adds handlers so -t can be used with -x.

Without a timeout dvbv5-zap will run forever if there's no signal,
preventing it's use by scripts to obtain signal stats.

Signed-off-by: Jemma Denson <jdenson@xxxxxxxxx>
---
 utils/dvb/dvbv5-zap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/utils/dvb/dvbv5-zap.c b/utils/dvb/dvbv5-zap.c
index e927383..2d19d45 100644
--- a/utils/dvb/dvbv5-zap.c
+++ b/utils/dvb/dvbv5-zap.c
@@ -855,6 +855,13 @@ int main(int argc, char **argv)
 		goto err;
 
 	if (args.exit_after_tuning) {
+		signal(SIGTERM, do_timeout);
+		signal(SIGINT, do_timeout);
+		if (args.timeout > 0) {
+			signal(SIGALRM, do_timeout);
+			alarm(args.timeout);
+		}
+
 		err = 0;
 		check_frontend(&args, parms);
 		goto err;
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux