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: fix tracing if cwd or file path is inaccessible · nodejs/node@4c9c1bb

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-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,13 @@ void NodeTraceWriter::OpenNewFileForStreaming() {
7777

7878
fd_ = uv_fs_open(tracing_loop_, &req, filepath.c_str(),
7979
O_CREAT | O_WRONLY | O_TRUNC, 0644, nullptr);
80-
CHECK_NE(fd_, -1);
8180
uv_fs_req_cleanup(&req);
81+
if (fd_ < 0) {
82+
fprintf(stderr, "Could not open trace file %s: %s\n",
83+
filepath.c_str(),
84+
uv_strerror(fd_));
85+
fd_ = -1;
86+
}
8287
}
8388

8489
void NodeTraceWriter::AppendTraceEvent(TraceObject* trace_event) {
@@ -145,6 +150,7 @@ void NodeTraceWriter::Flush(bool blocking) {
145150
}
146151

147152
void NodeTraceWriter::WriteToFile(std::string&& str, int highest_request_id) {
153+
if (fd_ == -1) return;
148154
WriteRequest* write_req = new WriteRequest();
149155
write_req->str = std::move(str);
150156
write_req->writer = this;

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.