Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

net: fix bogus errno reporting

_listen2() emits the error on the next tick. The errno value may have changed
by then.
  • Loading branch information...
commit 5d97d727536b33dfca6fc582033aed64f921f65f 1 parent c6bb361
@bnoordhuis bnoordhuis authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  lib/net.js
View
3  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;
}
Please sign in to comment.
Something went wrong with that request. Please try again.