- Notifications
You must be signed in to change notification settings - Fork2.2k
Close fds on error#5009
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Close fds on error#5009
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This function calls Init what normally never returns, so the defer onlyworks if there is an error and we can safely use it to close those fdswe opened. This was done for most but not all fds.Reported in issue 5008.Reported-by: Arina Cherednik <arinacherednik034@gmail.com>Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.Reported-by: Arina Cherednik <arinacherednik034@gmail.com>Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.Reported-by: Arina Cherednik <arinacherednik034@gmail.com>Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Reported in issue 5008.Reported-by: Arina Cherednik <arinacherednik034@gmail.com>Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
af89c02 to5c67cc3Compare
cyphar left a comment
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.
It still feels a bit strange todefer closing stuff instartInitialization but it is what it is...
kolyshkin commentedNov 13, 2025
There are a few (well, 3, to be exact) comments in there saying normally this function does not return and the defers are never called unless there's an error. Yet it takes some time to realize how things work here. |
Uh oh!
There was an error while loading.Please reload this page.
This addresses cases reported by@arinochk in#5008.
See individual commits for details.