]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/get_pid.c: pid_t is a signed integer
authorAlejandro Colomar <alx@kernel.org>
Sat, 22 Feb 2025 13:47:22 +0000 (14:47 +0100)
committerSerge Hallyn <serge@hallyn.com>
Sat, 7 Jun 2025 01:08:56 +0000 (20:08 -0500)
Print it with "%d".

Acked-by: Lukas Slebodnik <lslebodn@fedoraproject.org>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/get_pid.c

index 4a0c2efac9b8116ff8eb6f22da0d3f5e19be08a4..c687eab014c3aa8098339d3400c9fb5495ca1dd8 100644 (file)
@@ -57,15 +57,15 @@ int open_pidfd(const char *pidstr)
        if (get_pid(pidstr, &target) == -1)
                return -ENOENT;
 
-       if (SNPRINTF(proc_dir_name, "/proc/%u/", target) == -1) {
-               fprintf(stderr, "snprintf of proc path failed for %u: %s\n",
+       if (SNPRINTF(proc_dir_name, "/proc/%d/", target) == -1) {
+               fprintf(stderr, "snprintf of proc path failed for %d: %s\n",
                        target, strerror(errno));
                return -EINVAL;
        }
 
        proc_dir_fd = open(proc_dir_name, O_DIRECTORY);
        if (proc_dir_fd < 0) {
-               fprintf(stderr, _("Could not open proc directory for target %u: %s\n"),
+               fprintf(stderr, _("Could not open proc directory for target %d: %s\n"),
                        target, strerror(errno));
                return -EINVAL;
        }