Skip to content

Commit

Permalink
udp: use libuv API to get file descriptor
Browse files Browse the repository at this point in the history
Refs: #6838
PR-URL: #6908
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
saghul authored and rvagg committed Jun 2, 2016
1 parent a320a01 commit 36ed4a2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/udp_wrap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -139,12 +139,14 @@ void UDPWrap::New(const FunctionCallbackInfo<Value>& args) {


void UDPWrap::GetFD(Local<String>, const PropertyCallbackInfo<Value>& args) {
int fd = -1;
#if !defined(_WIN32)
HandleScope scope(args.GetIsolate());
UDPWrap* wrap = Unwrap<UDPWrap>(args.Holder());
int fd = (wrap == nullptr) ? -1 : wrap->handle_.io_watcher.fd;
args.GetReturnValue().Set(fd);
if (wrap != nullptr)
uv_fileno(reinterpret_cast<uv_handle_t*>(&wrap->handle_), &fd);
#endif
args.GetReturnValue().Set(fd);
}


Expand Down

1 comment on commit 36ed4a2

@MylesBorins
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like PR-URL and Ref got mixed up here

Please sign in to comment.