From 2e0a945d3d2bc6ea795e7148311c07c1073053b1 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 21 Oct 2018 13:22:52 +0200 Subject: vty.c: Set vty->fd to -1 after closing the FD Change-Id: I07d105f4a810dd809fbf6feb5c04e7410020c887 --- src/vty/vty.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vty/vty.c b/src/vty/vty.c index ad535371..70f6811a 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -221,8 +221,10 @@ void vty_close(struct vty *vty) vector_unset(vtyvec, vty->fd); /* Close socket. */ - if (vty->fd > 0) + if (vty->fd > 0) { close(vty->fd); + vty->fd = -1; + } if (vty->buf) { talloc_free(vty->buf); -- cgit v1.2.3