Remove old log semantics
authorRobert Swiecki <swiecki@google.com>
Tue, 15 Mar 2016 19:45:20 +0000 (20:45 +0100)
committerRobert Swiecki <swiecki@google.com>
Tue, 15 Mar 2016 19:45:20 +0000 (20:45 +0100)
log.c
log.h
subproc.c

diff --git a/log.c b/log.c
index 8612b4eca9d5b6b680114cdb7c080221e8a503f0..e6ca5b45e3168c2189a01a7d293048cd8e0b5249 100644 (file)
--- 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 f685039c93ee27e69261700396ee2ce9eaecda2f..d37e89c49ada00f34b107f001c3b55cedd7d2761 100644 (file)
--- 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 */
index c1e8ebc20e4dc5e680ce8c2d0235e1d34a8e15bc..1739460e61fb013e01e640e3ba3e2e6b74a2b59f 100644 (file)
--- 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) ;
 }