From: Robert Swiecki Date: Tue, 24 Oct 2017 14:20:51 +0000 (+0200) Subject: log: do isatty(log_fd) in log constructor X-Git-Tag: 2.2~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b6f703629e34b1cc37c2f4fbaffe496545675e90;p=platform%2Fupstream%2Fnsjail.git log: do isatty(log_fd) in log constructor --- diff --git a/log.c b/log.c index b63093d..66c664e 100644 --- a/log.c +++ b/log.c @@ -43,6 +43,8 @@ static enum llevel_t log_level = INFO; #define _LOG_DEFAULT_FILE "/var/log/nsjail.log" +__attribute__((constructor)) static void log_init(void) { log_fd_isatty = isatty(log_fd); } + /* * Log to stderr by default. Use a dup()d fd, because in the future we'll associate the * connection socket with fd (0, 1, 2).