Skip to content

Commit

Permalink
Fix ust_open when passing NULL
Browse files Browse the repository at this point in the history
This prevents an error message ("Failed to open ust trace file:") when
--ust-trace is not specified.
  • Loading branch information
bluewww committed Oct 19, 2018
1 parent 9a4ef86 commit 9a0f621
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions riscv/ust_tracer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ static bool has_output_header = false;

void ust_open(const char *filename)
{
if(!filename)
return;
s_trace = fopen(filename, "w");
if (!s_trace)
fprintf(stderr, "Failed to open ust trace file %s: %s",
Expand Down

0 comments on commit 9a0f621

Please sign in to comment.