For consistency, cast result of getpid() to long
This commit is contained in:
parent
83b718eb07
commit
34759932a8
@ -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 New Issue
Block a user