Skip to content

Commit

Permalink
Merge pull request #63 from greggman/master
Browse files Browse the repository at this point in the history
Make it not fail if it can't find /etc/resolv.conf
  • Loading branch information
taoeffect committed Jan 15, 2015
2 parents 6ce835d + 8b75198 commit 90f9325
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@ Platform.prototype.parseResolv = function() {

fs.readFile('/etc/resolv.conf', 'ascii', function(err, file) {
if (err) {
// If the file wasn't found don't worry about it.
if (err.code == 'ENOENT') {
return;
}
throw err;
}

file.split(/\n/).forEach(function(line) {
var i, parts, subparts;
line = line.replace(/^\s+|\s+$/g, '');
Expand Down

0 comments on commit 90f9325

Please sign in to comment.