net: report uv_tcp_open() errors#21428
Merged
cjihrig merged 1 commit intonodejs:masterfrom Jun 22, 2018
Merged
Conversation
bnoordhuis
approved these changes
Jun 20, 2018
src/tcp_wrap.cc
Outdated
| int fd = static_cast<int>(args[0]->IntegerValue()); | ||
| uv_tcp_open(&wrap->handle_, fd); | ||
| int err = uv_tcp_open(&wrap->handle_, fd); | ||
| wrap->set_fd(fd); |
Member
There was a problem hiding this comment.
Should this be if (err == 0) wrap->set_fd(fd);?
Contributor
Author
There was a problem hiding this comment.
It certainly could be. I'll update it. PipeWrap() does it this way, but it also throws from C++ instead of returning the error code.
jasnell
approved these changes
Jun 21, 2018
uv_tcp_open() can fail. Prior to this commit, any error was being silently ignored. This commit raises the errors. PR-URL: nodejs#21428 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Contributor
Author
|
Nit addressed. CI: https://ci.nodejs.org/job/node-test-pull-request/15565/. Only failure is #21425. |
targos
pushed a commit
that referenced
this pull request
Jun 24, 2018
uv_tcp_open() can fail. Prior to this commit, any error was being silently ignored. This commit raises the errors. PR-URL: #21428 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
uv_tcp_open()can fail. Prior to this commit, any error was being silently ignored. This commit raises the errors.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes