process: properly close file descriptor on exit
This makes sure the file descriptor is closed syncronously on exit instead of using the asyncronous version which should not be used on exit. PR-URL: https://github.com/nodejs/node/pull/24972 Refs: https://github.com/nodejs/node/pull/24965/files#r240770314 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
This commit is contained in:
parent
49f1db47e2
commit
80ab537ee6
@ -29,7 +29,9 @@ function writeOut(message) {
|
||||
function onClose(fd) {
|
||||
return () => {
|
||||
if (fs === null) fs = require('fs');
|
||||
fs.close(fd, nop);
|
||||
try {
|
||||
fs.closeSync(fd);
|
||||
} catch {}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user