bool containSetupFD(struct nsjconf_t * nsjconf, int fd_in, int fd_out, int fd_err, int fd_log)
{
/* Make sure all logs go to the parent process from now on */
- logNewLogFD(fd_log);
+ logRedirectLogFD(fd_log);
if (nsjconf->mode != MODE_LISTEN_TCP) {
if (nsjconf->is_silent == false) {
LOG_I("Server stops due to fatal signal (%d) caught. Exiting", sig);
}
-void logNewLogFD(int fd)
+void logRedirectLogFD(int fd)
{
log_fd = fd;
}
-void logDirectly(const char *msg)
+void logDirectlyToFD(const char *msg)
{
dprintf(log_fd, "%s", msg);
}
void logLog(enum llevel_t ll, const char *fn, int ln, bool perr, const char *fmt, ...)
__attribute__ ((format(printf, 5, 6)));
void logStop(int sig);
-void logNewLogFD(int fd);
-void logDirectly(const char *msg);
+void logRedirectLogFD(int fd);
+void logDirectlyToFD(const char *msg);
#endif /* _LOG_H */
ssize_t sz;
while ((sz = read(pipefd[0], log_buf, sizeof(log_buf) - 1)) > 0) {
log_buf[sz] = '\0';
- logDirectly(log_buf);
+ logDirectlyToFD(log_buf);
}
close(pipefd[0]);
close(pipefd[1]);