Explicitly cast getpid() result to int.

This placates cppcheck.
This commit is contained in:
Emil Mikulic 2016-01-13 20:18:30 +11:00
parent 955762645d
commit 24fa3798b2
1 changed files with 1 additions and 1 deletions

View File

@ -2581,7 +2581,7 @@ static void pidfile_create(void) {
err(1, "ftruncate() failed");
}
snprintf(pidstr, sizeof(pidstr), "%u", getpid());
snprintf(pidstr, sizeof(pidstr), "%d", (int)getpid());
if (pwrite(fd, pidstr, strlen(pidstr), 0) != (ssize_t)strlen(pidstr)) {
error = errno;
pidfile_remove();