GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — src: plug trace file file descriptor leak · nodejs/node@ce48936

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • src/tracing
    • node_trace_writer.cc
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/tracing/node_trace_writer.cc‎

Copy file name to clipboardExpand all lines: src/tracing/node_trace_writer.cc
+7-2Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ NodeTraceWriter::~NodeTraceWriter() {
5353
uv_fs_t req;
5454
int err;
5555
if (fd_ != -1) {
56-
err = uv_fs_close(tracing_loop_, &req, fd_, nullptr);
56+
err = uv_fs_close(nullptr, &req, fd_, nullptr);
5757
CHECK_EQ(err, 0);
5858
uv_fs_req_cleanup(&req);
5959
}
@@ -84,7 +84,12 @@ void NodeTraceWriter::OpenNewFileForStreaming() {
8484
replace_substring(&filepath, "${pid}", std::to_string(uv_os_getpid()));
8585
replace_substring(&filepath, "${rotation}", std::to_string(file_num_));
8686

87-
fd_ = uv_fs_open(tracing_loop_, &req, filepath.c_str(),
87+
if (fd_ != -1) {
88+
CHECK_EQ(uv_fs_close(nullptr, &req, fd_, nullptr), 0);
89+
uv_fs_req_cleanup(&req);
90+
}
91+
92+
fd_ = uv_fs_open(nullptr, &req, filepath.c_str(),
8893
O_CREAT | O_WRONLY | O_TRUNC, 0644, nullptr);
8994
uv_fs_req_cleanup(&req);
9095
if (fd_ < 0) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.