Skip to content

Commit

Permalink
Use process.stdin as default argument for listen()
Browse files Browse the repository at this point in the history
Replace { fd: 0 } with process.stdin, which should have
better compatibility with Windows.

Partial fix for #18
  • Loading branch information
fbbdev committed Oct 18, 2016
1 parent e35444a commit 551651b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ if (process.platform === "win32") {
}
} else {
exports.isService = function () {
return fs.fstatSync(0).isSocket();
return fs.fstatSync(process.stdin.fd).isSocket();
}
}
2 changes: 1 addition & 1 deletion lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Server.prototype.listen = function (callback) {
return net.Server.prototype.listen.apply(this, arguments);
}

return net.Server.prototype.listen.call(this, { fd: 0 }, callback);
return net.Server.prototype.listen.call(this, process.stdin, callback);
};

Server.prototype.setTimeout = function (msecs, callback) {
Expand Down

0 comments on commit 551651b

Please sign in to comment.