Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

Commit

Permalink
net: fix bogus errno reporting
Browse files Browse the repository at this point in the history
_listen2() emits the error on the next tick. The errno value may have changed
by then.
  • Loading branch information
bnoordhuis committed Jul 12, 2012
1 parent c6bb361 commit 5d97d72
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/net.js
Expand Up @@ -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;
}
Expand Down

0 comments on commit 5d97d72

Please sign in to comment.