From b0e5f195dfce3e2b99f5091373d49f6616682596 Mon Sep 17 00:00:00 2001 From: Timothy J Fontaine Date: Wed, 22 Jan 2014 21:05:51 -0800 Subject: src: lint lib/net.js --- lib/net.js | 41 +++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/lib/net.js b/lib/net.js index f59fd6642aa..5489b219109 100644 --- a/lib/net.js +++ b/lib/net.js @@ -1064,26 +1064,27 @@ function listen(self, address, port, addressType, backlog, fd) { cluster._getServer(self, address, port, addressType, fd, function(handle, err) { - // EACCESS and friends - if (err) { - self.emit('error', errnoException(err, 'bind')); - return; - } - - // Some operating systems (notably OS X and Solaris) don't report EADDRINUSE - // errors right away. libuv mimics that behavior for the sake of platform - // consistency but that means we have have a socket on our hands that is - // not actually bound. That's why we check if the actual port matches what - // we requested and if not, raise an error. The exception is when port == 0 - // because that means "any random port". - if (port && handle.getsockname && port != handle.getsockname().port) { - self.emit('error', errnoException('EADDRINUSE', 'bind')); - return; - } - - self._handle = handle; - self._listen2(address, port, addressType, backlog, fd); - }); + // EACCESS and friends + if (err) { + self.emit('error', errnoException(err, 'bind')); + return; + } + + // Some operating systems (notably OS X and Solaris) don't report + // EADDRINUSE errors right away. libuv mimics that behavior for the + // sake of platform consistency but that means we have have a socket on + // our hands that is not actually bound. That's why we check if the + // actual port matches what we requested and if not, raise an error. + // The exception is when port == 0 because that means "any random + // port". + if (port && handle.getsockname && port != handle.getsockname().port) { + self.emit('error', errnoException('EADDRINUSE', 'bind')); + return; + } + + self._handle = handle; + self._listen2(address, port, addressType, backlog, fd); + }); } -- cgit v1.2.3