diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2012-07-12 16:56:42 +0200 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2012-07-12 16:56:44 +0200 |
commit | 5d97d727536b33dfca6fc582033aed64f921f65f (patch) | |
tree | 126c8b7815b2ab0127795994b3420e2d8ff3a9de /lib | |
parent | c6bb361b8411132891bdbc816ceda6c147754cf6 (diff) | |
download | android-node-v8-5d97d727536b33dfca6fc582033aed64f921f65f.tar.gz android-node-v8-5d97d727536b33dfca6fc582033aed64f921f65f.tar.bz2 android-node-v8-5d97d727536b33dfca6fc582033aed64f921f65f.zip |
net: fix bogus errno reporting
_listen2() emits the error on the next tick. The errno value may have changed
by then.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/net.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/net.js b/lib/net.js index d6a01aa837..f129c0cce7 100644 --- a/lib/net.js +++ b/lib/net.js @@ -911,10 +911,11 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { r = self._handle.listen(backlog || 511); if (r) { + var ex = errnoException(errno, 'listen'); self._handle.close(); self._handle = null; process.nextTick(function() { - self.emit('error', errnoException(errno, 'listen')); + self.emit('error', ex); }); return; } |