镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
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 <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 944e75d commit a4068d9

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/internal/process/warning.js‎

Lines changed: 3 additions & 1 deletion
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)