Skip to content

Commit

Permalink
report: fix build warning in node_report.cc
Browse files Browse the repository at this point in the history
Fixes `maybe-uninitialized` build warning in `src/node_report.cc`.

PR-URL: nodejs#26265
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
richardlau committed Feb 28, 2019
1 parent cd302d7 commit 4a10ce6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -172,16 +172,14 @@ std::string TriggerNodeReport(Isolate* isolate,
std::cerr << " (errno: " << errno << ")" << std::endl;
return "";
}
outstream = &outfile;

std::cerr << std::endl
<< "Writing Node.js report to file: " << filename << std::endl;
}

// Pass our stream about by reference, not by copying it.
std::ostream& out = outfile.is_open() ? outfile : *outstream;

WriteNodeReport(
isolate, env, message, location, filename, out, stackstr, &tm_struct);
WriteNodeReport(isolate, env, message, location, filename, *outstream,
stackstr, &tm_struct);

// Do not close stdout/stderr, only close files we opened.
if (outfile.is_open()) {
Expand Down

0 comments on commit 4a10ce6

Please sign in to comment.