Skip to content

Commit

Permalink
lib: handle ENFILE error from fs.rmdir()
Browse files Browse the repository at this point in the history
  • Loading branch information
thangktran committed Nov 15, 2019
1 parent a4a089a commit 0d2c140
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/internal/fs/rimraf.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ function rimraf(path, options, callback) {
return setTimeout(_rimraf, busyTries * 100, path, options, CB);
}

if (err.code === 'EMFILE' && timeout < options.emfileWait)
if ((err.code === 'EMFILE' || err.code === 'ENFILE') &&
timeout < options.emfileWait)
return setTimeout(_rimraf, timeout++, path, options, CB);

// The file is already gone.
Expand Down

0 comments on commit 0d2c140

Please sign in to comment.