| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -136,12 +136,14 @@ void UDPWrap::New(const FunctionCallbackInfo<Value>& args) { | |||
| 136 | 136 | ||
| 137 | 137 | ||
| 138 | 138 | void UDPWrap::GetFD(Local<String>, const PropertyCallbackInfo<Value>& args) { | |
| 139 | + int fd = -1; | ||
| 139 | 140 | #if !defined(_WIN32) | |
| 140 | 141 | HandleScope scope(args.GetIsolate()); | |
| 141 | 142 | UDPWrap* wrap = Unwrap<UDPWrap>(args.Holder()); | |
| 142 | - int fd = (wrap == nullptr) ? -1 : wrap->handle_.io_watcher.fd; | ||
| 143 | - args.GetReturnValue().Set(fd); | ||
| 143 | + if (wrap != nullptr) | ||
| 144 | + uv_fileno(reinterpret_cast<uv_handle_t*>(&wrap->handle_), &fd); | ||
| 144 | 145 | #endif | |
| 146 | + args.GetReturnValue().Set(fd); | ||
| 145 | 147 | } | |
| 146 | 148 | ||
| 147 | 149 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments