Adjust for new constants.

This commit is contained in:
anseki 2019-07-27 21:55:29 +09:00
parent 12985521cf
commit 3d14a9a027

View file

@ -269,6 +269,9 @@ function _readlineSync(options) {
if (!fsB) {
fsB = process.binding('fs'); // For raw device path
constants = process.binding('constants');
// for v6.3.0+
constants = constants && constants.fs && typeof constants.fs.O_RDWR === 'number'
? constants.fs : constants;
}
return fsB;
}