-
Notifications
You must be signed in to change notification settings - Fork 1.6k
To improve the error handling of vtysh read config file #15568
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,42 @@ | |||
From 33a231ac26a46bfb728975d1695b7a71a7bc95ab Mon Sep 17 00:00:00 2001 | |||
From: stormliang <[email protected]> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this upstream patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I this is not upstream patch, I create this one.
} | ||
+ if (feof(fp)) { | ||
+ // Handle end-of-file (EOF) error | ||
+ vty_out(vty, "fgets error: End of file reached.\n"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
where do we see such message, in syslog?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is not ready for review yet, make it as draft.
/azp run Azure.sonic-buildimage |
Azure Pipelines successfully started running 1 pipeline(s). |
Why I did it
When read from config file, if any i/o error, vtysh_b will return but doesn't drop any error msg, that would lead to silent failure. In this PR to improve the error handling when read from config file.
Work item tracking
How I did it
To deal with error of fgets
How to verify it
PR test
Which release branch to backport (provide reason below if selected)
Tested branch (Please provide the tested image version)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)