If passed and invalid FD, _get_osfhandle() sets an error code through errno, not _doserrno. Hence we need to use SET_REQ_WIN32_ERROR insted of SET_REQ_RESULT. In debug builds, _get_osfhandle() also raises a superfluous assert. I implemented a wrapper that disables all asserts around the call to _get_osfhandle(). This fixes node.js unit tests test-fs-read-stream.js and test-listen-fd-ebadf.js. |
||
|---|---|---|
| .. | ||
| unix | ||
| win | ||
| fs-poll.c | ||
| inet.c | ||
| queue.h | ||
| uv-common.c | ||
| uv-common.h | ||
| version.c | ||