fs: make rmdir() emfileWait handle ENFILE
EMFILE: current process is out of file descriptorsENFILE: system is out of file descriptors
The fs.rmdir() logic in lib/internal/fs/rimraf.js currently handles the former but not the latter:
node/lib/internal/fs/rimraf.js
Lines 43 to 44 in ed40123
| if (err.code === 'EMFILE' && timeout < options.emfileWait) | |
| return setTimeout(_rimraf, timeout++, path, options, CB); |
Both are (hopefully) transient errors though and should be handled identically.
Since ENFILE is difficult to test for, I think it's okay to omit a regression test.