Skip to content

Commit

Permalink
trace: use secure fs_fopen()
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Feb 4, 2022
1 parent b61dce7 commit ea7641b
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include <re_list.h>
#include <re_tmr.h>
#include <re_lock.h>
#include <re_sys.h>

#ifdef HAVE_PTHREAD
#include <pthread.h>
Expand Down Expand Up @@ -108,11 +109,9 @@ int re_trace_init(const char *json_file)

lock_alloc(&trace.lock);

trace.f = fopen(json_file, "w+");
if (!trace.f) {
err = errno;
err = fs_fopen(&trace.f, json_file, "w+");
if (err)
goto out;
}

(void)re_fprintf(trace.f, "{\t\n\t\"traceEvents\": [\n");
(void)fflush(trace.f);
Expand Down

0 comments on commit ea7641b

Please sign in to comment.