summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2019-11-21 16:22:12 +0700
committerVadim Yanitskiy <axilirator@gmail.com>2019-11-21 16:22:21 +0700
commit02f25ea77bbf4a71a6d9012c750a6e5c1f70155c (patch)
treee004b0b202e79836f14f5aa1ec16f0a62eb97a0d /src
parentb639b4d4f7f3d51c50dd687a38690c57ba20dced (diff)
logging/vty: fix: do not close stderr in vty_close()
Since Icdeaea67a06da3a2f07b252e455629559ecc1829, we use stderr for printing warnings while parsing the VTY configuration files. Make sure we do not close() stderr. Otherwise stderr logging gets broken. Change-Id: I6ecc85555d102f5911d50ed5ac54933c766fa84d Fixes: Icdeaea67a06da3a2f07b252e455629559ecc1829
Diffstat (limited to 'src')
-rw-r--r--src/vty/vty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vty/vty.c b/src/vty/vty.c
index 3357d5a7..cd252ad1 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -231,7 +231,7 @@ void vty_close(struct vty *vty)
vector_unset(vtyvec, vty->fd);
/* Close socket. */
- if (vty->fd > 0) {
+ if (vty->fd > 0 && vty->fd != fileno(stderr)) {
close(vty->fd);
vty->fd = -1;
}