diff options
-rw-r--r-- | miscutils/chrt.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/miscutils/chrt.c b/miscutils/chrt.c index 4477d084c..1c6737a3c 100644 --- a/miscutils/chrt.c +++ b/miscutils/chrt.c | |||
@@ -53,23 +53,25 @@ int chrt_main(int argc UNUSED_PARAM, char **argv) | |||
53 | const char *current_new; | 53 | const char *current_new; |
54 | int policy = SCHED_RR; | 54 | int policy = SCHED_RR; |
55 | 55 | ||
56 | /* at least 1 arg; only one policy accepted */ | 56 | /* only one policy accepted */ |
57 | opt_complementary = "-1:r--fo:f--ro:o--rf"; | 57 | opt_complementary = "r--fo:f--ro:o--rf"; |
58 | opt = getopt32(argv, "+mprfo"); | 58 | opt = getopt32(argv, "+mprfo"); |
59 | if (opt & OPT_m) { /* print min/max and exit */ | ||
60 | show_min_max(SCHED_FIFO); | ||
61 | show_min_max(SCHED_RR); | ||
62 | show_min_max(SCHED_OTHER); | ||
63 | fflush_stdout_and_exit(EXIT_SUCCESS); | ||
64 | } | ||
59 | if (opt & OPT_r) | 65 | if (opt & OPT_r) |
60 | policy = SCHED_RR; | 66 | policy = SCHED_RR; |
61 | if (opt & OPT_f) | 67 | if (opt & OPT_f) |
62 | policy = SCHED_FIFO; | 68 | policy = SCHED_FIFO; |
63 | if (opt & OPT_o) | 69 | if (opt & OPT_o) |
64 | policy = SCHED_OTHER; | 70 | policy = SCHED_OTHER; |
65 | if (opt & OPT_m) { /* print min/max */ | ||
66 | show_min_max(SCHED_FIFO); | ||
67 | show_min_max(SCHED_RR); | ||
68 | show_min_max(SCHED_OTHER); | ||
69 | fflush_stdout_and_exit(EXIT_SUCCESS); | ||
70 | } | ||
71 | 71 | ||
72 | argv += optind; | 72 | argv += optind; |
73 | if (!argv[0]) | ||
74 | bb_show_usage(); | ||
73 | if (opt & OPT_p) { | 75 | if (opt & OPT_p) { |
74 | pid_str = *argv++; | 76 | pid_str = *argv++; |
75 | if (*argv) { /* "-p <priority> <pid> [...]" */ | 77 | if (*argv) { /* "-p <priority> <pid> [...]" */ |