]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
chrt: pass correct integer types to printf
authorThomas Weißschuh <thomas@t-8ch.de>
Sun, 12 Apr 2026 06:10:26 +0000 (08:10 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Sun, 12 Apr 2026 07:03:33 +0000 (09:03 +0200)
The printf format %ju expects an 'uintmax_t'. Cast the values to make
sure the correct type is passed.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
schedutils/chrt.c

index b5ddc53bdecb7141a9ef41cd4dc78e5a037fb988..273905e5d86dc0c148dc4b5cb5e648eb90f684df 100644 (file)
@@ -241,19 +241,19 @@ fallback:
 
        if (runtime && supports_custom_slice(policy)) {
                if (ctl->altered)
-                       printf(_("pid %d's new runtime parameter: %ju\n"), pid, runtime);
+                       printf(_("pid %d's new runtime parameter: %ju\n"), pid, (uintmax_t)runtime);
                else
-                       printf(_("pid %d's current runtime parameter: %ju\n"), pid, runtime);
+                       printf(_("pid %d's current runtime parameter: %ju\n"), pid, (uintmax_t)runtime);
        }
 
 #ifdef SCHED_DEADLINE
        if (policy == SCHED_DEADLINE) {
                if (ctl->altered)
                        printf(_("pid %d's new runtime/deadline/period parameters: %ju/%ju/%ju\n"),
-                                       pid, runtime, deadline, period);
+                                       pid, (uintmax_t)runtime, (uintmax_t)deadline, (uintmax_t)period);
                else
                        printf(_("pid %d's current runtime/deadline/period parameters: %ju/%ju/%ju\n"),
-                                       pid, runtime, deadline, period);
+                                       pid, (uintmax_t)runtime, (uintmax_t)deadline, (uintmax_t)period);
        }
 #endif
 }