All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: RT <linux-rt-users@vger.kernel.org>
Cc: Clark Williams <williams@redhat.com>, John Kacur <jkacur@redhat.com>
Subject: [PATCH 7/8] rt-tests: deadline_test: Exit with message if threads less than 1
Date: Fri, 27 Aug 2021 18:02:43 -0400	[thread overview]
Message-ID: <20210827220244.24210-8-jkacur@redhat.com> (raw)
In-Reply-To: <20210827220244.24210-1-jkacur@redhat.com>

If the user tries to run deadline_test with threads less than  1 (zero
for example), then exit with an error message.

Signed-off-by: John Kacur <jkacur@redhat.com>
---
 src/sched_deadline/deadline_test.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/sched_deadline/deadline_test.c b/src/sched_deadline/deadline_test.c
index 1763c71486a9..53abd4d2ca6b 100644
--- a/src/sched_deadline/deadline_test.c
+++ b/src/sched_deadline/deadline_test.c
@@ -1817,6 +1817,11 @@ int main(int argc, char **argv)
 		exit(-1);
 	}
 
+	if (nr_threads < 1) {
+		fprintf(stderr, "The number of threads must be at least 1\n");
+		exit(-1);
+	}
+
 	if (setcpu) {
 		nr_cpus = calc_nr_cpus(setcpu, &setcpu_buf);
 		if (nr_cpus < 0) {
-- 
2.31.1


  parent reply	other threads:[~2021-08-27 22:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 22:02 [PATCH 0/8] Some miscellanous fixes John Kacur
2021-08-27 22:02 ` [PATCH 1/8] rt-tests: deadline_test: Move va_start forward John Kacur
2021-08-27 22:02 ` [PATCH 2/8] rt-tests: deadline_test: Remove deadcode John Kacur
2021-08-27 22:02 ` [PATCH 3/8] rt-tests: ptsematest: " John Kacur
2021-08-27 22:02 ` [PATCH 4/8] rt-tests: pi_stress: Don't call free on alloca John Kacur
2021-08-27 22:02 ` [PATCH 5/8] rt-tests: pip_stress: Add missing paramater in error message John Kacur
2021-08-27 22:02 ` [PATCH 6/8] rt-tests: pi_stress: Add missing parameter and fix types John Kacur
2021-08-27 22:02 ` John Kacur [this message]
2021-08-27 22:02 ` [PATCH 8/8] rt-numa: Use sched_getaffinity() instead of pthread_getaffinity_np() John Kacur

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=20210827220244.24210-8-jkacur@redhat.com \
    --to=jkacur@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=williams@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.