Util-Linux package development
 help / color / mirror / Atom feed
* [PATCH 1/4] chrt: with more than one argument, interpret first argument as priority
@ 2025-06-30  8:40 Benno Schulenberg
  2025-06-30  8:40 ` [PATCH 2/4] chrt: do not try to interpret the --pid option itself as a PID Benno Schulenberg
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Benno Schulenberg @ 2025-06-30  8:40 UTC (permalink / raw)
  To: util-linux; +Cc: Madadi Vineeth Reddy

The first argument is a priority not only for `chrt --pid <prio> <pid>`
but also for `chrt <prio> <command> [<argument>...]`.

This fixes an oversight in recent commit e7a2d62434.

CC: Madadi Vineeth Reddy <vineethr@linux.ibm.com>
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
---
 schedutils/chrt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index 0bcdd1a1e..4c45eae80 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -530,7 +530,7 @@ int main(int argc, char **argv)
 
 	errno = 0;
 
-	if (need_prio || argc - optind == 2)
+	if (need_prio || argc - optind > 1)
 		ctl->priority = strtos32_or_err(argv[optind], _("invalid priority argument"));
 	else
 		ctl->priority = 0;
-- 

Dobjátok a Dunába a kis diktátort.

2.48.1


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2025-07-02 14:53 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-30  8:40 [PATCH 1/4] chrt: with more than one argument, interpret first argument as priority Benno Schulenberg
2025-06-30  8:40 ` [PATCH 2/4] chrt: do not try to interpret the --pid option itself as a PID Benno Schulenberg
2025-07-01  5:05   ` Madadi Vineeth Reddy
2025-07-01 13:34     ` Benno Schulenberg
2025-07-02  8:30       ` Karel Zak
2025-06-30  8:40 ` [PATCH 3/4] chrt: simplify the other check for too few arguments Benno Schulenberg
2025-07-01  5:16   ` Madadi Vineeth Reddy
2025-07-01 13:39     ` Benno Schulenberg
2025-07-02  9:01       ` Karel Zak
2025-07-02 13:39         ` Benno Schulenberg
2025-07-02 14:52           ` Karel Zak
2025-06-30  8:40 ` [PATCH 4/4] chrt: do not try to interpret any other option as a PID either Benno Schulenberg
2025-07-01  5:21   ` Madadi Vineeth Reddy
2025-07-01 13:52     ` Benno Schulenberg
2025-07-01  4:57 ` [PATCH 1/4] chrt: with more than one argument, interpret first argument as priority Madadi Vineeth Reddy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox