Skip to content

libstd/sys/*/net: clean up API error checks. #32510

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

Merged
merged 1 commit into from
Mar 27, 2016

Conversation

nodakai
Copy link
Contributor

@nodakai nodakai commented Mar 26, 2016

  1. Slightly improve cvt_gai() and cvt().
  2. Remove now redundant cvt_r().

@rust-highfive
Copy link
Contributor

r? @aturon

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

@@ -167,7 +167,7 @@ impl TcpStream {
let sock = Socket::new(addr, c::SOCK_STREAM)?;

let (addrp, len) = addr.into_inner();
cvt_r(|| unsafe { c::connect(*sock.as_inner(), addrp, len) })?;
cvt(unsafe { c::connect(*sock.as_inner(), addrp, len) })?;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are these switching away from cvt_r? They're supposed to handle EINTR internally and this change means that they no longer handle that.

@nodakai nodakai force-pushed the libstd-sys-net-error-check branch from 0b277b0 to bf94aef Compare March 26, 2016 21:21
@nodakai
Copy link
Contributor Author

nodakai commented Mar 26, 2016

@alexcrichton Apologies, I must have been absent... I was reviving a very old patch of mine and screwed it up in the end

@alexcrichton
Copy link
Member

@bors: r+ bf94aef

@bors
Copy link
Collaborator

bors commented Mar 27, 2016

⌛ Testing commit bf94aef with merge a18e124...

bors added a commit that referenced this pull request Mar 27, 2016
…hton

libstd/sys/*/net: clean up API error checks.

1. Slightly improve `cvt_gai()` and `cvt()`.
2. Remove now redundant `cvt_r()`.
@bors bors merged commit bf94aef into rust-lang:master Mar 27, 2016
@nodakai nodakai deleted the libstd-sys-net-error-check branch March 27, 2016 08:45
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.

5 participants