Skip to content

Commit a4068d9

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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
1 parent 944e75d commit a4068d9

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)