summaryrefslogtreecommitdiff
path: root/lib/vty.c
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2023-09-20 15:27:23 +0200
committerDavid Lamparter <equinox@opensourcerouting.org>2023-09-20 16:07:24 +0200
commit448d690a354c3ea481aba6254a285937d843cf81 (patch)
treec3c0397bba55d7629b9a0311708096791aecc4ef /lib/vty.c
parent592011b25160ed6bc476e6855784ed2a7c8f3bc6 (diff)
lib: random make-coverity-happy nits
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/vty.c')
-rw-r--r--lib/vty.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/vty.c b/lib/vty.c
index 23aa2d1f38..8f8effa9cc 100644
--- a/lib/vty.c
+++ b/lib/vty.c
@@ -2368,8 +2368,7 @@ static void vtysh_read(struct event *thread)
printf("result: %d\n", ret);
printf("vtysh node: %d\n", vty->node);
#endif /* VTYSH_DEBUG */
-
- if (vty->pass_fd != -1) {
+ if (vty->pass_fd >= 0) {
memset(vty->pass_fd_status, 0, 4);
vty->pass_fd_status[3] = ret;
vty->status = VTY_PASSFD;
@@ -2387,7 +2386,9 @@ static void vtysh_read(struct event *thread)
* => skip vty_event(VTYSH_READ, vty)!
*/
return;
- }
+ } else
+ /* normalize other invalid values */
+ vty->pass_fd = -1;
/* hack for asynchronous "write integrated"
* - other commands in "buf" will be ditched