When daemonizing, we need to use /dev/null for stdin, stdout, and
stderr. If one of these file descriptors happen to be already closed,
we need to close the new file descriptor only if > 2. This is
confusing confusing for Coverity, annotate it correctly.
Not all locations are annotated because not all of them are detected,
for some reason.
if (fd > 2)
(void)close (fd);
}
+ /* coverity[resource_leak]
+ fd may be leaked if < 2, it's expected */
return (0);
}
dup2(fd, STDERR_FILENO);
if (fd > 2) close(fd);
}
+ /* coverity[resource_leak]
+ fd may be leaked if < 2, it's expected */
}
log_debug("main", "lldpd " PACKAGE_VERSION " starting...");
version_check();