sanitize: check return value

This commit is contained in:
Loïc Gomez 2022-01-09 18:25:44 +01:00 committed by Pierre-Louis Bonicoli
parent 2a5e7b6f7b
commit 9d6394679f
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD
1 changed files with 4 additions and 1 deletions

View File

@ -296,7 +296,10 @@ int main(int argc, char **argv)
else
pid = getpid();
snprintf(buf, (size_t) 29, "%lu\n", (unsigned long int)pid);
write(fd, buf, strlen(buf));
ssize_t written;
written = write(fd, buf, strlen(buf));
if (written <= 0)
mylog(LOG_ERROR, "Could not write to PID file");
close(fd);
bip.listener = listen_new(conf_ip, conf_port, conf_css);