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