]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
textual: harmonize the wording of the error message for an invalid PID
authorBenno Schulenberg <bensberg@telfort.nl>
Wed, 28 May 2025 09:37:04 +0000 (11:37 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 29 May 2025 10:04:28 +0000 (12:04 +0200)
Having four different forms for the same basic message is unneeded.

Signed-off-by: Benno Schulenberg <bensberg@telfort.nl>
misc-utils/kill.c
misc-utils/lsclocks.c
misc-utils/lslocks.c
misc-utils/waitpid.c
schedutils/coresched.c
schedutils/taskset.c
sys-utils/setpriv.c

index fefe0d89179be93216c5f84f892374dff5d12e78..81dd5f191152b1fce6101ab07d59fc26484be669 100644 (file)
@@ -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);
                }
index 376bc6e51d14d67b958214f0066be32823e1f666..42a91fb9486b1cdc5fea8a9dba634f0ea7dbc43b 100644 (file)
@@ -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);
index e5889020734154d80168875cea8b90104a49789e..4ed3a371660ffbdd90350da4078a69510cef5a6b 100644 (file)
@@ -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)
index 4d77e1df44ee44809308c6679265184ef6176ae0..379246b268d6649ee9f63d017b31a082e35e3b09 100644 (file)
@@ -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;
 }
index 7634d988cd36505556b8e17421c163b6af03da92..419745897e1654ca80bd7ef37749d9bf8e08cc83 100644 (file)
@@ -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);
index 46fef5051c70228d2de544453e63d0712505e869..dedcdf602948bdb426f39f43ffc022bd6f9f5ac7 100644 (file)
@@ -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;
index 10274f5f660ae6534929ab7dac23fb4561d20df0..d714650e8d4e6a9150c99a5c2f0b60cafb63088b 100644 (file)
@@ -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"));
        }
 }