Skip to content

Commit 80ab537

Browse files
BridgeARTrott
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: nodejs#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 49f1db4 commit 80ab537

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
@@ -29,7 +29,9 @@ function writeOut(message) {
2929
function onClose(fd) {
3030
return () => {
3131
if (fs === null) fs = require('fs');
32-
fs.close(fd, nop);
32+
try {
33+
fs.closeSync(fd);
34+
} catch {}
3335
};
3436
}
3537

0 commit comments

Comments
 (0)