summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimothy J Fontaine <tjfontaine@gmail.com>2014-01-22 21:05:51 -0800
committerTimothy J Fontaine <tjfontaine@gmail.com>2014-01-22 21:05:51 -0800
commitb0e5f195dfce3e2b99f5091373d49f6616682596 (patch)
tree8fd90af89684ce58f5711ee64f1b89eeaeec0934
parentbc2f31ae1d05de123615241543fbe2282689b6c0 (diff)
downloadnode-v0.10.25-release.tar.gz
src: lint lib/net.jsv0.10.25v0.10.25-release
-rw-r--r--lib/net.js41
1 files changed, 21 insertions, 20 deletions
diff --git a/lib/net.js b/lib/net.js
index f59fd6642..5489b2191 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);
+ });
}