We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d0105c commit 0c2d1d5Copy full SHA for 0c2d1d5
lib/net.js
@@ -263,9 +263,16 @@ function Socket(options) {
263
const { fd } = options;
264
let err;
265
266
+ // createHandle will throw ERR_INVALID_FD_TYPE if `fd` is not
267
+ // a valid `PIPE` or `TCP` descriptor
268
this._handle = createHandle(fd, false);
269
270
err = this._handle.open(fd);
271
+
272
+ // While difficult to fabricate, in some architectures
273
+ // `open` may return an error code for valid file descriptors
274
+ // which cannot be opened. This is difficult to test as most
275
+ // un-openable fds will throw on `createHandle`
276
if (err)
277
throw errnoException(err, 'open');
278
0 commit comments