diff options
author | Ben Noordhuis <info@bnoordhuis.nl> | 2013-02-28 17:50:14 +0100 |
---|---|---|
committer | Ben Noordhuis <info@bnoordhuis.nl> | 2013-02-28 23:11:47 +0100 |
commit | 12d0f0bd3a6c8491837b710b01816f40f32fb56b (patch) | |
tree | 84fd203cb13540b19c91a66d65c6a7b9fceedfe7 /lib/net.js | |
parent | 1762ba37ca810d44933ae850fd4fd00fd16be732 (diff) | |
download | android-node-v8-12d0f0bd3a6c8491837b710b01816f40f32fb56b.tar.gz android-node-v8-12d0f0bd3a6c8491837b710b01816f40f32fb56b.tar.bz2 android-node-v8-12d0f0bd3a6c8491837b710b01816f40f32fb56b.zip |
lib, src: remove errno global
Remove the errno global. It's a property on the process object now.
Fixes #3095.
Diffstat (limited to 'lib/net.js')
-rw-r--r-- | lib/net.js | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/lib/net.js b/lib/net.js index 714e5bb0a0..d5e85b17e8 100644 --- a/lib/net.js +++ b/lib/net.js @@ -198,7 +198,7 @@ function onSocketFinish() { var shutdownReq = this._handle.shutdown(); if (!shutdownReq) - return this._destroy(errnoException(errno, 'shutdown')); + return this._destroy(errnoException(process._errno, 'shutdown')); shutdownReq.oncomplete = afterShutdown; } @@ -351,7 +351,7 @@ Socket.prototype._read = function(n, callback) { this._handle.reading = true; var r = this._handle.readStart(); if (r) - this._destroy(errnoException(errno, 'read')); + this._destroy(errnoException(process._errno, 'read')); } else { debug('readStart already has been called.'); } @@ -453,7 +453,7 @@ function onread(buffer, offset, length) { timers.active(self); var end = offset + length; - debug('onread', global.errno, offset, length, end); + debug('onread', process._errno, offset, length, end); if (buffer) { debug('got data'); @@ -484,10 +484,10 @@ function onread(buffer, offset, length) { debug('readStop'); var r = handle.readStop(); if (r) - self._destroy(errnoException(errno, 'read')); + self._destroy(errnoException(process._errno, 'read')); } - } else if (errno == 'EOF') { + } else if (process._errno == 'EOF') { debug('EOF'); if (self._readableState.length === 0) @@ -503,9 +503,9 @@ function onread(buffer, offset, length) { // procedure. No need to wait for all the data to be consumed. self.emit('_socketEnd'); } else { - debug('error', errno); + debug('error', process._errno); // Error - self._destroy(errnoException(errno, 'read')); + self._destroy(errnoException(process._errno, 'read')); } } @@ -594,7 +594,7 @@ Socket.prototype._write = function(dataEncoding, cb) { var writeReq = createWriteReq(this._handle, data, enc); if (!writeReq || typeof writeReq !== 'object') - return this._destroy(errnoException(errno, 'write'), cb); + return this._destroy(errnoException(process._errno, 'write'), cb); writeReq.oncomplete = afterWrite; this._bytesDispatched += writeReq.bytes; @@ -661,8 +661,8 @@ function afterWrite(status, handle, req) { } if (status) { - debug('write failure', errnoException(errno, 'write')); - self._destroy(errnoException(errno, 'write'), req.cb); + debug('write failure', errnoException(process._errno, 'write')); + self._destroy(errnoException(process._errno, 'write'), req.cb); return; } @@ -691,7 +691,7 @@ function connect(self, address, port, addressType, localAddress) { } if (r) { - self._destroy(errnoException(errno, 'bind')); + self._destroy(errnoException(process._errno, 'bind')); return; } } @@ -708,7 +708,7 @@ function connect(self, address, port, addressType, localAddress) { if (connectReq !== null) { connectReq.oncomplete = afterConnect; } else { - self._destroy(errnoException(errno, 'connect')); + self._destroy(errnoException(process._errno, 'connect')); } } @@ -834,7 +834,7 @@ function afterConnect(status, handle, req, readable, writable) { } else { self._connecting = false; - self._destroy(errnoException(errno, 'connect')); + self._destroy(errnoException(process._errno, 'connect')); } } @@ -922,7 +922,7 @@ var createServerHandle = exports._createServerHandle = default: // Not a fd we can listen on. This will trigger an error. debug('listen invalid fd=' + fd + ' type=' + type); - global.errno = 'EINVAL'; // hack, callers expect that errno is set + process._errno = 'EINVAL'; // hack, callers expect that errno is set handle = null; break; } @@ -969,7 +969,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { debug('_listen2: create a handle'); self._handle = createServerHandle(address, port, addressType, fd); if (!self._handle) { - var error = errnoException(errno, 'listen'); + var error = errnoException(process._errno, 'listen'); process.nextTick(function() { self.emit('error', error); }); @@ -988,7 +988,7 @@ Server.prototype._listen2 = function(address, port, addressType, backlog, fd) { r = self._handle.listen(backlog || 511); if (r) { - var ex = errnoException(errno, 'listen'); + var ex = errnoException(process._errno, 'listen'); self._handle.close(); self._handle = null; process.nextTick(function() { @@ -1096,7 +1096,7 @@ function onconnection(clientHandle) { debug('onconnection'); if (!clientHandle) { - self.emit('error', errnoException(errno, 'accept')); + self.emit('error', errnoException(process._errno, 'accept')); return; } |