Permalink
Browse files

removed 2.x ENOENT compat

  • Loading branch information...
tj committed Aug 16, 2011
1 parent cbcb0d8 commit c410e442ff784c97cd48b5cdcf47ff80ff5ace27
Showing with 1 addition and 4 deletions.
  1. +1 −4 lib/master.js
View
@@ -22,9 +22,6 @@ var Worker = require('./worker')
, socketpair = netBinding.socketpair
, close = netBinding.close
, unlink = fsBinding.unlink
- , ENOENT = process.version >= 'v0.4.0'
- ? require('constants').ENOENT
- : process.ENOENT
, dgram = require('dgram')
, net = require('net')
, fs = require('fs')
@@ -782,7 +779,7 @@ Master.prototype.startListening = function(shouldBind){
// remove unix domain socket
if ('string' == typeof this.port && shouldBind) {
fs.unlink(this.port, function(err){
- if (ENOENT != err.errno) throw err;
+ if ('ENOENT' != err.code) throw err;
@fredericosilva

fredericosilva Sep 23, 2011

err is null when unlink removes the file. This will lead to a "TypeError: Cannot read property 'code' of null"

@tj

tj Sep 23, 2011

Member

shit, yeah this should be (err && .... thanks for catching that

startListening();
});
} else {

0 comments on commit c410e44

Please sign in to comment.