From: Christian Goeschel Ndjomouo Date: Tue, 21 Apr 2026 15:35:25 +0000 (-0400) Subject: chrt: report actual PID in error message when 0 is specified X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=92017ab9397150347a7989c2af926f7b071187dc;p=thirdparty%2Futil-linux.git chrt: report actual PID in error message when 0 is specified Signed-off-by: Christian Goeschel Ndjomouo --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index 3e4ea41d5..7d920deea 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -402,7 +402,7 @@ static void set_sched(struct chrt_ctl *ctl) err(EXIT_FAILURE, _("cannot obtain the list of tasks")); #endif } else if (set_sched_one(ctl, ctl->pid) == -1) - err(EXIT_FAILURE, _("failed to set pid %d's policy"), ctl->pid); + err(EXIT_FAILURE, _("failed to set pid %d's policy"), ctl->pid ? ctl->pid : getpid()); ctl->altered = 1; }