projects
/
platform
/
upstream
/
nsjail.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80f902f
)
log: do isatty(log_fd) in log constructor
author
Robert Swiecki
<robert@swiecki.net>
Tue, 24 Oct 2017 14:20:51 +0000
(16:20 +0200)
committer
Robert Swiecki
<robert@swiecki.net>
Tue, 24 Oct 2017 14:20:51 +0000
(16:20 +0200)
log.c
patch
|
blob
|
history
diff --git
a/log.c
b/log.c
index
b63093d
..
66c664e
100644
(file)
--- 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).