diff options
| author | Benno Schulenberg <bensberg@telfort.nl> | 2025-05-28 11:37:04 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2025-05-29 12:04:28 +0200 |
| commit | 46608e3d7e8ca309589d0321bf911e19c7d26dd3 (patch) | |
| tree | 2fbf10e1b91a7257efb6afa7be4db5f3eedc74d3 | |
| parent | 078b3fb834d77af566be4c636058d9104cb94a4a (diff) | |
| download | util-linux-46608e3d7e8ca309589d0321bf911e19c7d26dd3.tar.gz | |
textual: harmonize the wording of the error message for an invalid PID
Having four different forms for the same basic message is unneeded.
Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
| -rw-r--r-- | misc-utils/kill.c | 4 | ||||
| -rw-r--r-- | misc-utils/lsclocks.c | 2 | ||||
| -rw-r--r-- | misc-utils/lslocks.c | 2 | ||||
| -rw-r--r-- | misc-utils/waitpid.c | 2 | ||||
| -rw-r--r-- | schedutils/coresched.c | 5 | ||||
| -rw-r--r-- | schedutils/taskset.c | 3 | ||||
| -rw-r--r-- | sys-utils/setpriv.c | 2 |
7 files changed, 9 insertions, 11 deletions
diff --git a/misc-utils/kill.c b/misc-utils/kill.c index fefe0d8917..81dd5f1911 100644 --- a/misc-utils/kill.c +++ b/misc-utils/kill.c @@ -396,7 +396,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl) if (2 < argc) errx(EXIT_FAILURE, _("too many arguments")); arg = argv[1]; - pid = strtopid_or_err(arg, _("invalid pid argument")); + pid = strtopid_or_err(arg, _("invalid PID argument")); print_process_signal_state(pid); exit(EXIT_SUCCESS); } @@ -404,7 +404,7 @@ static char **parse_arguments(int argc, char **argv, struct kill_control *ctl) pid_t pid; char *p = strchr(arg, '=') + 1; - pid = strtopid_or_err(p, _("invalid pid argument")); + pid = strtopid_or_err(p, _("invalid PID argument")); print_process_signal_state((pid_t)pid); exit(EXIT_SUCCESS); } diff --git a/misc-utils/lsclocks.c b/misc-utils/lsclocks.c index 376bc6e51d..42a91fb948 100644 --- a/misc-utils/lsclocks.c +++ b/misc-utils/lsclocks.c @@ -593,7 +593,7 @@ int main(int argc, char **argv) break; case 'c': cpu_clock = xmalloc(sizeof(*cpu_clock)); - cpu_clock->pid = strtopid_or_err(optarg, _("failed to parse pid")); + cpu_clock->pid = strtopid_or_err(optarg, _("invalid PID argument")); snprintf(cpu_clock->name, sizeof(cpu_clock->name), "%jd", (intmax_t) cpu_clock->pid); list_add(&cpu_clock->head, &cpu_clocks); diff --git a/misc-utils/lslocks.c b/misc-utils/lslocks.c index e588902073..4ed3a37166 100644 --- a/misc-utils/lslocks.c +++ b/misc-utils/lslocks.c @@ -383,7 +383,7 @@ static struct lock *get_lock(char *buf, struct override_info *oinfo, void *fallb l->cmdname = xstrdup(oinfo->cmdname); } else { /* strtopid_or_err() is not suitable here; tok can be -1.*/ - l->pid = strtos32_or_err(tok, _("failed to parse pid")); + l->pid = strtos32_or_err(tok, _("invalid PID argument")); if (l->pid > 0) { l->cmdname = pid_get_cmdname(l->pid); if (!l->cmdname) diff --git a/misc-utils/waitpid.c b/misc-utils/waitpid.c index 4d77e1df44..379246b268 100644 --- a/misc-utils/waitpid.c +++ b/misc-utils/waitpid.c @@ -51,7 +51,7 @@ static pid_t *parse_pids(size_t n_strings, char * const *strings) pid_t *pids = xcalloc(n_strings, sizeof(*pids)); for (size_t i = 0; i < n_strings; i++) - pids[i] = strtopid_or_err(strings[i], _("failed to parse pid")); + pids[i] = strtopid_or_err(strings[i], _("invalid PID argument")); return pids; } diff --git a/schedutils/coresched.c b/schedutils/coresched.c index 7634d988cd..419745897e 100644 --- a/schedutils/coresched.c +++ b/schedutils/coresched.c @@ -232,12 +232,11 @@ static void parse_and_verify_arguments(int argc, char **argv, struct args *args) switch (c) { case 's': args->src = strtopid_or_err( - optarg, - _("Failed to parse PID for -s/--source")); + optarg, _("invalid PID for -s/--source")); break; case 'd': args->dest = strtopid_or_err( - optarg, _("Failed to parse PID for -d/--dest")); + optarg, _("invalid PID for -d/--dest")); break; case 't': args->type = parse_core_sched_type(optarg); diff --git a/schedutils/taskset.c b/schedutils/taskset.c index 46fef5051c..dedcdf6029 100644 --- a/schedutils/taskset.c +++ b/schedutils/taskset.c @@ -187,8 +187,7 @@ int main(int argc, char **argv) all_tasks = 1; break; case 'p': - pid = strtopid_or_err(argv[argc - 1], - _("invalid PID argument")); + pid = strtopid_or_err(argv[argc - 1], _("invalid PID argument")); break; case 'c': ts.use_list = 1; diff --git a/sys-utils/setpriv.c b/sys-utils/setpriv.c index 10274f5f66..d714650e8d 100644 --- a/sys-utils/setpriv.c +++ b/sys-utils/setpriv.c @@ -473,7 +473,7 @@ static void parse_ptracer(struct privctx *opts, const char *str) } else if (!strcmp(str, "none")) { opts->ptracer = 0; } else { - opts->ptracer = strtopid_or_err(str, _("failed to parse ptracer pid")); + opts->ptracer = strtopid_or_err(str, _("invalid PID argument")); } } |
