From c069c10bad4eece7d129886f375d20d547ccf144 Mon Sep 17 00:00:00 2001 From: Madadi Vineeth Reddy Date: Sun, 22 Jun 2025 01:20:46 +0530 Subject: [PATCH] chrt: Make minor cleanups in chrt Minor changes such as fixing an incorrect comment and aligning the closing brace of an if condition in main() were made, along with making the usage of --pid consistent across files instead of -p, although -p still works, for better readability. No functional change is intended. Signed-off-by: Madadi Vineeth Reddy --- schedutils/chrt.1.adoc | 10 +++++----- schedutils/chrt.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/schedutils/chrt.1.adoc b/schedutils/chrt.1.adoc index 77add535d..36cdcc5fe 100644 --- a/schedutils/chrt.1.adoc +++ b/schedutils/chrt.1.adoc @@ -40,7 +40,7 @@ chrt - manipulate the real-time attributes of a process *chrt* [options] _priority command argument_ ... -*chrt* [options] *-p* [_priority_] _PID_ +*chrt* [options] *--pid* [_priority_] _PID_ == DESCRIPTION @@ -117,20 +117,20 @@ ____ //TRANSLATORS: Keep {colon} untranslated You can also retrieve the real-time attributes of an existing task{colon}:: ____ -*chrt -p* _PID_ +*chrt --pid* _PID_ ____ //TRANSLATORS: Keep {colon} untranslated Or set them{colon}:: ____ -*chrt -r -p* _priority PID_ +*chrt -r --pid* _priority PID_ ____ This, for example, sets real-time scheduling to priority _30_ for the process _PID_ with the *SCHED_RR* (round-robin) class{colon}:: ____ -*chrt -r -p 30* _PID_ +*chrt -r --pid 30* _PID_ ____ Reset priorities to default for a process{colon}:: ____ -*chrt -o -p 0* _PID_ +*chrt -o --pid 0* _PID_ ____ See *sched*(7) for a detailed discussion of the different scheduler classes and how they interact. diff --git a/schedutils/chrt.c b/schedutils/chrt.c index cf99935dc..8fe748f43 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -64,7 +64,7 @@ static void __attribute__((__noreturn__)) usage(void) " chrt [options] --pid \n"), out); fputs(USAGE_SEPARATOR, out); fputs(_("Get policy:\n" - " chrt [options] -p \n"), out); + " chrt [options] --pid \n"), out); fputs(USAGE_SEPARATOR, out); fputs(_("Policy options:\n"), out); @@ -341,7 +341,7 @@ static int set_sched_one(struct chrt_ctl *ctl, pid_t pid) return set_sched_one_by_setscheduler(ctl, pid); } -#else /* !HAVE_SCHED_SETATTR */ +#else /* HAVE_SCHED_SETATTR */ static int set_sched_one(struct chrt_ctl *ctl, pid_t pid) { struct sched_attr sa = { .size = sizeof(struct sched_attr) }; @@ -499,7 +499,7 @@ int main(int argc, char **argv) ((ctl->pid == -1) && argc - optind < 2)) { warnx(_("bad usage")); errtryhelp(EXIT_FAILURE); -} + } if ((ctl->pid > -1) && (ctl->verbose || argc - optind == 1)) { show_sched_info(ctl); -- 2.47.3