From f17c13645c4716e1573b8a96274f83ac40a1ce07 Mon Sep 17 00:00:00 2001 From: Robert Swiecki Date: Tue, 15 Mar 2016 20:45:20 +0100 Subject: [PATCH] Remove old log semantics --- log.c | 10 ---------- log.h | 2 -- subproc.c | 6 +----- 3 files changed, 1 insertion(+), 17 deletions(-) diff --git a/log.c b/log.c index 8612b4e..e6ca5b4 100644 --- a/log.c +++ b/log.c @@ -128,13 +128,3 @@ void logStop(int sig) { LOG_I("Server stops due to fatal signal (%d) caught. Exiting", sig); } - -void logRedirectLogFD(int fd) -{ - log_fd = fd; -} - -void logDirectlyToFD(const char *msg) -{ - dprintf(log_fd, "%s", msg); -} diff --git a/log.h b/log.h index f685039..d37e89c 100644 --- a/log.h +++ b/log.h @@ -56,7 +56,5 @@ bool logInitLogFile(struct nsjconf_t *nsjconf, const char *logfile, bool is_verb 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 logRedirectLogFD(int fd); -void logDirectlyToFD(const char *msg); #endif /* NS_LOG_H */ diff --git a/subproc.c b/subproc.c index c1e8ebc..1739460 100644 --- a/subproc.c +++ b/subproc.c @@ -274,9 +274,5 @@ void subprocRunChild(struct nsjconf_t *nsjconf, int fd_in, int fd_out, int fd_er LOG_I("PID: %d about to execute '%s' for %s", pid, nsjconf->argv[0], cs_addr); char log_buf[4096]; - ssize_t sz; - while ((sz = read(sv[1], log_buf, sizeof(log_buf) - 1)) > 0) { - log_buf[sz] = '\0'; - logDirectlyToFD(log_buf); - } + while (read(sv[1], log_buf, sizeof(log_buf)) > 0 || errno == EINTR) ; }