For consistency, cast result of getpid() to long

This commit is contained in:
Kevin Lo 2010-08-31 07:19:10 +00:00
parent 83b718eb07
commit 34759932a8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=212048
2 changed files with 3 additions and 2 deletions

View file

@ -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);

View file

@ -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);
}
}