Skip to content

Commit

Permalink
PLAT-605: make use of "localtime_r" rather than "localtime", which is…
Browse files Browse the repository at this point in the history
… not thread safe and can cause deadlocks within the libc
  • Loading branch information
Wolfgang Sourdeau committed Jul 28, 2014
1 parent b567c8d commit 216fde4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion arch/exception_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,10 @@ void trace_exception(void * object, const std::type_info * tinfo)

time_t now;
time(&now);
strftime(datetime, sizeof(datetime), "%FT%H:%M:%S", localtime(&now));

struct tm lt_tm;
strftime(datetime, sizeof(datetime), "%FT%H:%M:%S",
localtime_r(&now, &lt_tm));

const char * demangled;
char * heapDemangled;
Expand Down

0 comments on commit 216fde4

Please sign in to comment.