From: Jemma Denson <jdenson@gmail.com>
To: mchehab@osg.samsung.com
Cc: linux-media@vger.kernel.org
Subject: [v4l-utils PATCH-v2 2/4] dvbv5-zap.c: allow timeout with -x
Date: Fri, 18 Dec 2015 14:28:24 +0000 [thread overview]
Message-ID: <1450448906-17000-3-git-send-email-jdenson@gmail.com> (raw)
In-Reply-To: <1450448906-17000-1-git-send-email-jdenson@gmail.com>
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@gmail.com>
---
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
next prev parent reply other threads:[~2015-12-18 14:29 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-18 14:28 Patches to dvbv5-zap Jemma Denson
2015-12-18 14:28 ` [v4l-utils PATCH-v2 1/4] dvbv5-zap.c: fix setting signal handlers Jemma Denson
2015-12-18 14:28 ` Jemma Denson [this message]
2015-12-18 14:28 ` [v4l-utils PATCH-v2 3/4] dvbv5-zap.c: fix wrong signal Jemma Denson
2015-12-18 14:28 ` [v4l-utils PATCH-v2 4/4] dvbv5-zap.c: Move common signals code into function Jemma Denson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1450448906-17000-3-git-send-email-jdenson@gmail.com \
--to=jdenson@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@osg.samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).