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

When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno. #36754

Merged
merged 1 commit into from Sep 27, 2016
Merged

When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno. #36754

merged 1 commit into from Sep 27, 2016

Conversation

ghost
Copy link

@ghost ghost commented Sep 26, 2016

Fixes issue #36546. This change also updates libc to earliest version
that includes EAI_SYSTEM constant.

Previously, in cases where EAI_SYSTEM has been returned from getaddrinfo, the
resulting io::Error would be broadly described as "System error":

Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) }

After change a more detailed error is crated based on particular value of
errno, for example:

Error { repr: Os { code: 64, message: "Machine is not on the network" } }

The only downside is that the prefix "failed to lookup address information" is
no longer included in the error message.

Fixes issue #36546. This change also updates libc to earliest version
that includes EAI_SYSTEM constant.
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@alexcrichton
Copy link
Member

@bors: r+

@bors
Copy link
Contributor

bors commented Sep 27, 2016

📌 Commit c52b957 has been approved by alexcrichton

@alexcrichton
Copy link
Member

Thanks!

sophiajt pushed a commit to sophiajt/rust that referenced this pull request Sep 27, 2016
…richton

When getaddrinfo returns EAI_SYSTEM retrieve actual error from errno.

Fixes issue rust-lang#36546. This change also updates libc to earliest version
that includes EAI_SYSTEM constant.

Previously, in cases where `EAI_SYSTEM` has been returned from getaddrinfo, the
resulting `io::Error` would be broadly described as "System error":

    Error { repr: Custom(Custom { kind: Other, error: StringError("failed to lookup address information: System error") }) }

After change a more detailed error is crated based on particular value of
errno, for example:

    Error { repr: Os { code: 64, message: "Machine is not on the network" } }

The only downside is that the prefix "failed to lookup address information" is
no longer included in the error message.
bors added a commit that referenced this pull request Sep 27, 2016
@bors bors merged commit c52b957 into rust-lang:master Sep 27, 2016
@ghost ghost deleted the getaddrinfo-errors branch September 27, 2016 15:23
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.

4 participants