From c122e9bf6274da51ac01b8331fcef0699d115351 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 29 Mar 2020 09:11:57 -0600 Subject: [PATCH] Write process ID as an unsigned int (with a cast). On Solaris, pid_t may be typedef'd as a long but the actual range is 32 bits at most. --- logsrvd/logsrvd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/logsrvd/logsrvd.c b/logsrvd/logsrvd.c index 983836c23..4e7369962 100644 --- a/logsrvd/logsrvd.c +++ b/logsrvd/logsrvd.c @@ -1680,7 +1680,7 @@ daemonize(bool nofork) if (fp == NULL) { sudo_warn("%s", logsrvd_conf_pid_file()); } else { - fprintf(fp, "%d\n", getpid()); + fprintf(fp, "%u\n", (unsigned int)getpid()); fclose(fp); } }