diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-12-18 02:59:09 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-12-18 02:59:09 +0100 |
commit | 96c8a6b5eade530f28ef73f72f7d188f71bbb1ec (patch) | |
tree | 888084971182da49254e79e550a86d30e3654401 | |
parent | b2fa0b6219bc8f0e37ea68fc036857a4714fa175 (diff) | |
download | busybox-w32-96c8a6b5eade530f28ef73f72f7d188f71bbb1ec.tar.gz busybox-w32-96c8a6b5eade530f28ef73f72f7d188f71bbb1ec.tar.bz2 busybox-w32-96c8a6b5eade530f28ef73f72f7d188f71bbb1ec.zip |
chrt: correct opt_complementary. Closes bug 2977
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | miscutils/chrt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/miscutils/chrt.c b/miscutils/chrt.c index c40277b39..4477d084c 100644 --- a/miscutils/chrt.c +++ b/miscutils/chrt.c | |||
@@ -54,7 +54,7 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) | |||
54 | int policy = SCHED_RR; | 54 | int policy = SCHED_RR; |
55 | 55 | ||
56 | /* at least 1 arg; only one policy accepted */ | 56 | /* at least 1 arg; only one policy accepted */ |
57 | opt_complementary = "-1:r--fo:f--ro:r--fo"; | 57 | opt_complementary = "-1:r--fo:f--ro:o--rf"; |
58 | opt = getopt32(argv, "+mprfo"); | 58 | opt = getopt32(argv, "+mprfo"); |
59 | if (opt & OPT_r) | 59 | if (opt & OPT_r) |
60 | policy = SCHED_RR; | 60 | policy = SCHED_RR; |
@@ -90,13 +90,13 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) | |||
90 | print_rt_info: | 90 | print_rt_info: |
91 | pol = sched_getscheduler(pid); | 91 | pol = sched_getscheduler(pid); |
92 | if (pol < 0) | 92 | if (pol < 0) |
93 | bb_perror_msg_and_die("can't %cet pid %d's policy", 'g', pid); | 93 | bb_perror_msg_and_die("can't %cet pid %d's policy", 'g', (int)pid); |
94 | printf("pid %d's %s scheduling policy: %s\n", | 94 | printf("pid %d's %s scheduling policy: %s\n", |
95 | pid, current_new, policies[pol].name); | 95 | pid, current_new, policies[pol].name); |
96 | if (sched_getparam(pid, &sp)) | 96 | if (sched_getparam(pid, &sp)) |
97 | bb_perror_msg_and_die("can't get pid %d's attributes", pid); | 97 | bb_perror_msg_and_die("can't get pid %d's attributes", (int)pid); |
98 | printf("pid %d's %s scheduling priority: %d\n", | 98 | printf("pid %d's %s scheduling priority: %d\n", |
99 | pid, current_new, sp.sched_priority); | 99 | (int)pid, current_new, sp.sched_priority); |
100 | if (!*argv) { | 100 | if (!*argv) { |
101 | /* Either it was just "-p <pid>", | 101 | /* Either it was just "-p <pid>", |
102 | * or it was "-p <priority> <pid>" and we came here | 102 | * or it was "-p <priority> <pid>" and we came here |
@@ -115,7 +115,7 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) | |||
115 | sp.sched_priority = xstrtou_range(priority, 0, policy != SCHED_OTHER ? 1 : 0, 99); | 115 | sp.sched_priority = xstrtou_range(priority, 0, policy != SCHED_OTHER ? 1 : 0, 99); |
116 | 116 | ||
117 | if (sched_setscheduler(pid, policy, &sp) < 0) | 117 | if (sched_setscheduler(pid, policy, &sp) < 0) |
118 | bb_perror_msg_and_die("can't %cet pid %d's policy", 's', pid); | 118 | bb_perror_msg_and_die("can't %cet pid %d's policy", 's', (int)pid); |
119 | 119 | ||
120 | if (!argv[0]) /* "-p <priority> <pid> [...]" */ | 120 | if (!argv[0]) /* "-p <priority> <pid> [...]" */ |
121 | goto print_rt_info; | 121 | goto print_rt_info; |