From: Karel Zak Date: Tue, 15 May 2012 15:45:05 +0000 (+0200) Subject: schedutils: cleanup strtoxx_or_err() X-Git-Tag: v2.22-rc1~402 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=630ed89d5adc4868106fbc9608c1f822b881e191;p=thirdparty%2Futil-linux.git schedutils: cleanup strtoxx_or_err() Signed-off-by: Karel Zak --- diff --git a/schedutils/chrt.c b/schedutils/chrt.c index cbf2417e89..95a6adca4f 100644 --- a/schedutils/chrt.c +++ b/schedutils/chrt.c @@ -254,7 +254,7 @@ int main(int argc, char **argv) break; case 'p': errno = 0; - pid = strtol_or_err(argv[argc - 1], _("failed to parse pid")); + pid = strtos32_or_err(argv[argc - 1], _("invalid PID argument")); break; case 'r': policy = SCHED_RR; @@ -296,7 +296,7 @@ int main(int argc, char **argv) } errno = 0; - priority = strtol_or_err(argv[optind], _("failed to parse priority")); + priority = strtos32_or_err(argv[optind], _("invalid priority argument")); #ifdef SCHED_RESET_ON_FORK /* sanity check */ diff --git a/schedutils/ionice.c b/schedutils/ionice.c index 5fdeccf8de..e25428d94a 100644 --- a/schedutils/ionice.c +++ b/schedutils/ionice.c @@ -145,13 +145,13 @@ int main(int argc, char **argv) while ((c = getopt_long(argc, argv, "+n:c:p:tVh", longopts, NULL)) != EOF) switch (c) { case 'n': - data = strtol_or_err(optarg, _("failed to parse class data")); + data = strtos32_or_err(optarg, _("invalid class data argument")); set |= 1; break; case 'c': if (isdigit(*optarg)) - ioclass = strtol_or_err(optarg, - _("failed to parse class")); + ioclass = strtos32_or_err(optarg, + _("invalid class argument")); else { ioclass = parse_ioclass(optarg); if (ioclass < 0) @@ -162,7 +162,7 @@ int main(int argc, char **argv) set |= 2; break; case 'p': - pid = strtol_or_err(optarg, _("failed to parse pid")); + pid = strtos32_or_err(optarg, _("invalid PID argument")); break; case 't': tolerant = 1; @@ -210,7 +210,7 @@ int main(int argc, char **argv) ioprio_print(pid); for(; argv[optind]; ++optind) { - pid = strtol_or_err(argv[optind], _("failed to parse pid")); + pid = strtos32_or_err(argv[optind], _("invalid PID argument")); ioprio_print(pid); } } else if (set && pid) { @@ -220,7 +220,7 @@ int main(int argc, char **argv) ioprio_setpid(pid, ioclass, data); for(; argv[optind]; ++optind) { - pid = strtol_or_err(argv[optind], _("failed to parse pid")); + pid = strtos32_or_err(argv[optind], _("invalid PID argument")); ioprio_setpid(pid, ioclass, data); } } else if (argv[optind]) { diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 908ac8e2d8..c1bb17343b 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -157,8 +157,8 @@ int main(int argc, char **argv) all_tasks = 1; break; case 'p': - pid = strtol_or_err(argv[argc - 1], - _("failed to parse pid")); + pid = strtos32_or_err(argv[argc - 1], + _("invalid PID argument")); break; case 'c': ts.use_list = 1;