mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-06 17:18:32 +00:00
For consistency, cast result of getpid() to long
This commit is contained in:
parent
83b718eb07
commit
34759932a8
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212048
|
@ -165,7 +165,8 @@ main(int argc, char **argv)
|
|||
if (demon) {
|
||||
fp = open(pidfile, O_WRONLY|O_CREAT, S_IRUSR|S_IRGRP|S_IROTH);
|
||||
if (fp >= 0) {
|
||||
sz1 = snprintf(buf, sizeof buf, "%d\n", getpid());
|
||||
sz1 = snprintf(buf, sizeof buf, "%ld\n",
|
||||
(long)getpid());
|
||||
if (sz1 > sizeof buf)
|
||||
sz1 = sizeof buf;
|
||||
write(fp, buf, sz1);
|
||||
|
|
|
@ -435,7 +435,7 @@ write_pid(void)
|
|||
FILE *fp = fopen(apmd_pidfile, "w");
|
||||
|
||||
if (fp) {
|
||||
fprintf(fp, "%d\n", getpid());
|
||||
fprintf(fp, "%ld\n", (long)getpid());
|
||||
fclose(fp);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue