diff options
Diffstat (limited to 'vtysh/vtysh.c')
| -rw-r--r-- | vtysh/vtysh.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 2d80feef6c..5a54c60c6b 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -280,9 +280,6 @@ static int vtysh_client_run(struct vtysh_client *vclient, const char *line, nread = vtysh_client_receive( vclient, bufvalid, buf + bufsz - bufvalid - 1, pass_fd); - if (nread < 0 && (errno == EINTR || errno == EAGAIN)) - continue; - if (nread <= 0) { if (vty->of) vty_out(vty, @@ -698,7 +695,7 @@ static char *trim(char *s) int vtysh_mark_file(const char *filename) { struct vty *vty; - FILE *confp = NULL; + FILE *confp = NULL, *closefp = NULL; int ret; vector vline; int tried = 0; @@ -711,7 +708,7 @@ int vtysh_mark_file(const char *filename) if (strncmp("-", filename, 1) == 0) confp = stdin; else - confp = fopen(filename, "r"); + confp = closefp = fopen(filename, "r"); if (confp == NULL) { fprintf(stderr, "%% Can't open config file %s due to '%s'.\n", @@ -851,9 +848,8 @@ int vtysh_mark_file(const char *filename) vty_close(vty); XFREE(MTYPE_VTYSH_CMD, vty_buf_copy); - if (confp != stdin) - fclose(confp); - + if (closefp) + fclose(closefp); return 0; } |
