diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-07-12 18:16:57 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-07-12 18:18:38 +0200 |
commit | 3a6314dbe159c40aa4cd95786bf55f6dcd0580bb (patch) | |
tree | 8efa569ba2a7a961dae9e7fb7b2323bdbb008799 /lib | |
parent | 5d97d727536b33dfca6fc582033aed64f921f65f (diff) | |
download | nodejs-3a6314dbe159c40aa4cd95786bf55f6dcd0580bb.tar.gz nodejs-3a6314dbe159c40aa4cd95786bf55f6dcd0580bb.tar.bz2 nodejs-3a6314dbe159c40aa4cd95786bf55f6dcd0580bb.zip |
net: fix net.Server.listen({fd:x}) error reporting
* don't assert when fd isn't an open file descriptor
* don't die with a ReferenceError when fd isn't a file descriptor
you can listen() on
Fixes #3699.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/net.js b/lib/net.js index f129c0cce..f5d3ebdd2 100644 --- a/lib/net.js +++ b/lib/net.js @@ -851,6 +851,7 @@ var createServerHandle = exports._createServerHandle = default: // Not a fd we can listen on. This will trigger an error. debug('listen invalid fd=' + fd + ' type=' + type); + global.errno = 'EINVAL'; // hack, callers expect that errno is set handle = null; break; } |