summaryrefslogtreecommitdiff
path: root/lib/libfrr.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-08-11 15:43:28 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2017-08-11 15:45:56 +0200
commiteef3d03026f6bd6e7528c0250a0a34f57c6bf756 (patch)
tree12c6b2469f53f756df8f9d69458df6e924082d3c /lib/libfrr.c
parent2cb5980f20bb642e60484a1647031cb6f013ddc3 (diff)
lib: don't close stdio when running foreground
c9c8d0d ("lib: close stdin/out/err in non-terminal case") overshot its goal and closes stdin/stdout/stderr even when a daemon is running in foreground. That means stdout logging & exit memory reporting are both broken. Reported-by: Lou Berger <lberger@labn.net> Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/libfrr.c')
-rw-r--r--lib/libfrr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libfrr.c b/lib/libfrr.c
index e5573da900..a5c87e6edc 100644
--- a/lib/libfrr.c
+++ b/lib/libfrr.c
@@ -812,7 +812,7 @@ void frr_run(struct thread_master *master)
thread_add_read(master, frr_daemon_ctl, NULL,
daemon_ctl_sock, &daemon_ctl_thread);
}
- } else {
+ } else if (di->daemon_mode) {
int nullfd = open("/dev/null", O_RDONLY | O_NOCTTY);
dup2(nullfd, 0);
dup2(nullfd, 1);