fix EXECPATH_FD premature close

This commit is contained in:
Igor Klopov 2017-05-08 10:45:51 -07:00
parent e81e798cfe
commit 054ea5282e
4 changed files with 4 additions and 4 deletions

View File

@ -240,7 +240,7 @@
+ (function () {
+ var fd = fs.openSync(process.execPath, 'r');
+ var result = readPrelude(fd);
+ if (!result || result.undoPatch) {
+ if (result && result.undoPatch) {
+ fs.closeSync(fd);
+ // need to revert patch to node/lib/module.js
+ var bindingFs = process.binding('fs');

View File

@ -301,7 +301,7 @@
+ (function () {
+ var fd = fs.openSync(process.execPath, 'r');
+ var result = readPrelude(fd);
+ if (!result || result.undoPatch) {
+ if (result && result.undoPatch) {
+ fs.closeSync(fd);
+ // need to revert patch to node/lib/module.js
+ var bindingFs = process.binding('fs');

View File

@ -198,7 +198,7 @@
+ (function () {
+ var fd = fs.openSync(process.execPath, 'r');
+ var result = readPrelude(fd);
+ if (!result || result.undoPatch) {
+ if (result && result.undoPatch) {
+ fs.closeSync(fd);
+ // need to revert patch to node/lib/module.js
+ var bindingFs = process.binding('fs');

View File

@ -212,7 +212,7 @@
+ (function () {
+ var fd = fs.openSync(process.execPath, 'r');
+ var result = readPrelude(fd);
+ if (!result || result.undoPatch) {
+ if (result && result.undoPatch) {
+ fs.closeSync(fd);
+ // need to revert patch to node/lib/module.js
+ var bindingFs = process.binding('fs');