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

Prevent SIGPIPE on Darwin when writing to a closed core:net socket #4029

Merged
merged 3 commits into from
Aug 5, 2024

Conversation

Feoramund
Copy link
Contributor

Mimics behavior found on Linux implementation.

Mimics behavior found on Linux implementation.
@Feoramund Feoramund mentioned this pull request Aug 5, 2024
8 tasks
@laytan
Copy link
Collaborator

laytan commented Aug 5, 2024

Should probably handle the EPIPE error too, it will now be a "bad enum value" error.

Linux does this:

		if errno == .EPIPE {
			// If the peer is disconnected when we are trying to send we will get an `EPIPE` error,
			// so we turn that into a clearer error
			return total_written, TCP_Send_Error.Connection_Closed

core/net/socket_darwin.odin Outdated Show resolved Hide resolved
core/net/socket_darwin.odin Outdated Show resolved Hide resolved
@Feoramund Feoramund force-pushed the fix-darwin-sigpipe-send branch from 846a21a to 4c0ab09 Compare August 5, 2024 17:15
@laytan laytan merged commit a1c3c38 into odin-lang:master Aug 5, 2024
6 checks passed
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.

3 participants