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

bsd_close_socket preserves the error code #196

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

aditmak
Copy link

@aditmak aditmak commented Feb 21, 2023

I am using the uWebsocket application. When I call the application's listen function to open the port and begin listening it failed.
Because the application failed to listen, it closes the socket and exits gracefully. So, if there is an error while opening the port, the errno variable is updated with the error code then the close socket function is called and it updates the errno, causing the error information from the listening socket failure to be lost.
By preserving the errno after the close socket function, the real error can be determined.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant