Commit e1a8986f by Maxime Gregoire Committed by Maxime Grégoire

Replaced fopen every trace call by a single fopen when tracing/dumping data

Change-Id: If752b2db0f3bd7125508b88f32248af6fa3c598d Reviewed-on: https://swiftshader-review.googlesource.com/2340Tested-by: 's avatarMaxime Grégoire <mgregoire@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent fceb1837
...@@ -22,12 +22,15 @@ namespace es ...@@ -22,12 +22,15 @@ namespace es
{ {
if(false) if(false)
{ {
FILE* file = fopen(TRACE_OUTPUT_FILE, "a"); static FILE* file = nullptr;
if(!file)
{
file = fopen(TRACE_OUTPUT_FILE, "w");
}
if(file) if(file)
{ {
vfprintf(file, format, vararg); vfprintf(file, format, vararg);
fclose(file);
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment