From 74d076caf1837ddacae0f7cd5d9e6ee0b47d63d2 Mon Sep 17 00:00:00 2001 From: isaacs Date: Sun, 5 Aug 2012 14:22:44 -0700 Subject: [PATCH] errnoException must be done immediately --- lib/net.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/net.js b/lib/net.js index 61b103a85da..d6e3d5adae1 100644 --- a/lib/net.js +++ b/lib/net.js @@ -926,8 +926,9 @@ function listen(self, address, port, addressType, backlog, fd) { if (!self._handle) { self._handle = createServerHandle(address, port, addressType, fd); if (!self._handle) { + var error = errnoException(errno, 'listen'); process.nextTick(function() { - self.emit('error', errnoException(errno, 'listen')); + self.emit('error', error); }); return; }