linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Boris Egorov <egorov@linux.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	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 20:30:36 +0600	[thread overview]
Message-ID: <54E3508C.3080704@linux.com> (raw)
In-Reply-To: <20150217140838.GP26177@linutronix.de>

Looks like this patch is not applied yet.

I can move value check to parse_options and send another version of
patch. As for macros - yes, I already mentioned them in debian bug
report thread. There are three of them (INTERVAL, RUN_INTERVAL,
PROGRESS_CHARS) which are improperly (IMO) used instead of corresponding
lowercase variables. I thought these changes should go to another patch.

On 02/17/2015 08:08 PM, Sebastian Andrzej Siewior wrote:
> * 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
> 

-- 
Best regards,
Boris Egorov

  reply	other threads:[~2015-02-17 14:30 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
2015-02-17 14:30   ` Boris Egorov [this message]
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=54E3508C.3080704@linux.com \
    --to=egorov@linux.com \
    --cc=716237@bugs.debian.org \
    --cc=bigeasy@linutronix.de \
    --cc=clark.williams@gmail.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).