Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vtysh_config: do not warn about non-existing configuration file #14969

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
vtysh_config: do not warn about non-existing configuration file
We not always check return status, so it is not fatal to have missing file.
And when it is fatal, we check status and print another message.
  • Loading branch information
Dmitry Levin committed Dec 8, 2023
commit 2bd938d52b6cbe93ad65cd6870ec914789b1e63b
6 changes: 1 addition & 5 deletions vtysh/vtysh_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,12 +638,8 @@ static int vtysh_read_config(const char *config_file_path, bool dry_run)
int ret;

confp = fopen(config_file_path, "r");
if (confp == NULL) {
fprintf(stderr,
"%% Can't open configuration file %s due to '%s'.\n",
config_file_path, safe_strerror(errno));
if (confp == NULL)
return CMD_ERR_NO_FILE;
}

save = vtysh_add_timestamp;
vtysh_add_timestamp = false;
Expand Down