Skip to content

Commit 551651b

Browse files
committed
Use process.stdin as default argument for listen()
Replace { fd: 0 } with process.stdin, which should have better compatibility with Windows. Partial fix for #18
1 parent e35444a commit 551651b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@ if (process.platform === "win32") {
5757
}
5858
} else {
5959
exports.isService = function () {
60-
return fs.fstatSync(0).isSocket();
60+
return fs.fstatSync(process.stdin.fd).isSocket();
6161
}
6262
}

lib/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Server.prototype.listen = function (callback) {
111111
return net.Server.prototype.listen.apply(this, arguments);
112112
}
113113

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

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

0 commit comments

Comments
 (0)