]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chrt: Make minor cleanups in chrt
authorMadadi Vineeth Reddy <vineethr@linux.ibm.com>
Sat, 21 Jun 2025 19:50:46 +0000 (01:20 +0530)
committerKarel Zak <kzak@redhat.com>
Mon, 23 Jun 2025 11:22:25 +0000 (13:22 +0200)
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 <vineethr@linux.ibm.com>
schedutils/chrt.1.adoc
schedutils/chrt.c

index 77add535dba98a4cca76eb1a032affa1cdf0e283..36cdcc5fe53b08347e23238d1f4aa5ab67dc3321 100644 (file)
@@ -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.
 
index cf99935dc4938582ebd36cddc460081319b9fcd1..8fe748f434b5c4b41210bc7b5300cc9da8429060 100644 (file)
@@ -64,7 +64,7 @@ static void __attribute__((__noreturn__)) usage(void)
        " chrt [options] --pid <priority> <pid>\n"), out);
        fputs(USAGE_SEPARATOR, out);
        fputs(_("Get policy:\n"
-       " chrt [options] -p <pid>\n"), out);
+       " chrt [options] --pid <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);