Skip to content

Commit f43f45a

Browse files
BridgeARBethGriggs
authored andcommitted
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: #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>
1 parent 5f8950b commit f43f45a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/process/warning.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,9 @@ function writeOut(message) {
2222
function onClose(fd) {
2323
return () => {
2424
if (fs === null) fs = require('fs');
25-
fs.close(fd, nop);
25+
try {
26+
fs.closeSync(fd);
27+
} catch {}
2628
};
2729
}
2830

0 commit comments

Comments
 (0)