diff options
author | Benno Schulenberg | 2010-06-14 19:47:08 +0200 |
---|---|---|
committer | Karel Zak | 2010-06-15 12:23:47 +0200 |
commit | a9a3e5f2f994d3f723c4eee87969dc0db69f8cdf (patch) | |
tree | 24704795f044b3ef525e4239a451e82647268cb7 /schedutils/chrt.c | |
parent | mount: use %u for uid_t and gid_t (diff) | |
download | kernel-qcow2-util-linux-a9a3e5f2f994d3f723c4eee87969dc0db69f8cdf.tar.gz kernel-qcow2-util-linux-a9a3e5f2f994d3f723c4eee87969dc0db69f8cdf.tar.xz kernel-qcow2-util-linux-a9a3e5f2f994d3f723c4eee87969dc0db69f8cdf.zip |
chrt: change two messages into four translatable sentences
In several languages the translations for "current" and "new" will
have to be slightly different depending on whether they apply to
"policy" or "priority". (As a general rule, translatable messages
should be full sentences, and not partial ones with optional words
filled in via %s.)
Signed-off-by: Benno Schulenberg <bensberg@justemail.net>
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'schedutils/chrt.c')
-rw-r--r-- | schedutils/chrt.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/schedutils/chrt.c b/schedutils/chrt.c index cc40013c8..8044d39ce 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -80,7 +80,7 @@ static void show_usage(int rc) exit(rc); } -static void show_rt_info(const char *what, pid_t pid) +static void show_rt_info(pid_t pid, int isnew) { struct sched_param sp; int policy; @@ -93,7 +93,11 @@ static void show_rt_info(const char *what, pid_t pid) if (policy == -1) err(EXIT_FAILURE, _("failed to get pid %d's policy"), pid); - printf(_("pid %d's %s scheduling policy: "), pid, what); + if (isnew) + printf(_("pid %d's new scheduling policy: "), pid); + else + printf(_("pid %d's current scheduling policy: "), pid); + switch (policy) { case SCHED_OTHER: printf("SCHED_OTHER\n"); @@ -131,8 +135,12 @@ static void show_rt_info(const char *what, pid_t pid) if (sched_getparam(pid, &sp)) err(EXIT_FAILURE, _("failed to get pid %d's attributes"), pid); - printf(_("pid %d's %s scheduling priority: %d\n"), - pid, what, sp.sched_priority); + if (isnew) + printf(_("pid %d's new scheduling priority: %d\n"), + pid, sp.sched_priority); + else + printf(_("pid %d's current scheduling priority: %d\n"), + pid, sp.sched_priority); } static void show_min_max(void) @@ -247,7 +255,7 @@ int main(int argc, char *argv[]) show_usage(EXIT_FAILURE); if ((pid > -1) && (verbose || argc - optind == 1)) { - show_rt_info(_("current"), pid); + show_rt_info(pid, FALSE); if (argc - optind == 1) return EXIT_SUCCESS; } @@ -274,7 +282,7 @@ int main(int argc, char *argv[]) err(EXIT_FAILURE, _("failed to set pid %d's policy"), pid); if (verbose) - show_rt_info(_("new"), pid); + show_rt_info(pid, TRUE); if (!pid) { argv += optind + 1; |