From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Boris Egorov <egorov@linux.com>,
Clark Williams <clark.williams@gmail.com>
Cc: 716237@bugs.debian.org, linux-rt-users@vger.kernel.org
Subject: Re: [PATCH] rt-migrate-test: exit early if nr_runs is non-positive
Date: Tue, 17 Feb 2015 15:08:38 +0100 [thread overview]
Message-ID: <20150217140838.GP26177@linutronix.de> (raw)
In-Reply-To: <5476FAF2.1060702@linux.com>
* Boris Egorov | 2014-11-27 16:20:34 [+0600]:
>Program will crash if nr_runs is 0 due to dividing by it in
>print_results(). Let's exit early instead.
>
>Fixes: http://bugs.debian.org/716237
Has this been dealt with? I can't see this applied. I would prefer
doing the value check in parse_options() itself. And looking at it, it
seems that run_interval is interval ignored. Or is there macro magic
invovled?
>Signed-off-by: Boris Egorov <egorov@linux.com>
>---
> src/rt-migrate-test/rt-migrate-test.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/src/rt-migrate-test/rt-migrate-test.c
>b/src/rt-migrate-test/rt-migrate-test.c
>index e3c7a09..876a122 100644
>--- a/src/rt-migrate-test/rt-migrate-test.c
>+++ b/src/rt-migrate-test/rt-migrate-test.c
>@@ -465,6 +465,11 @@ int main (int argc, char **argv)
> parse_options(argc, argv);
>+ if (nr_runs <= 0) {
>+ fprintf(stderr, "Warning, --loops argument is non-positive. Exiting.\n");
>+ exit(-1);
>+ }
>+
> signal(SIGINT, stop_log);
> if (argc >= (optind + 1))
>--
>2.1.3
Sebastian
next prev parent reply other threads:[~2015-02-17 14:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-27 10:20 [PATCH] rt-migrate-test: exit early if nr_runs is non-positive Boris Egorov
2015-02-17 14:08 ` Sebastian Andrzej Siewior [this message]
2015-02-17 14:30 ` Boris Egorov
2015-02-17 14:35 ` Boris Egorov
2015-02-17 16:51 ` John Kacur
2015-02-17 17:43 ` [PATCH v2 0/2] rt-migrate-test: few sanity fixes Boris Egorov
2015-02-17 17:43 ` [PATCH v2 1/2] rt-migrate-test: exit early if nr_runs is non-positive Boris Egorov
2015-02-17 17:43 ` [PATCH v2 2/2] rt-migrate-test: use variables instead of macros Boris Egorov
2015-02-17 19:27 ` [PATCH v2 0/2] rt-migrate-test: few sanity fixes Clark Williams
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=20150217140838.GP26177@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=716237@bugs.debian.org \
--cc=clark.williams@gmail.com \
--cc=egorov@linux.com \
--cc=linux-rt-users@vger.kernel.org \
/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).