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 <[email protected]>
---
 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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to