diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2021-08-09 16:14:37 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2021-08-10 00:39:27 +0200 |
commit | 2fca31ccc14c0655a21bdc9058096107cd38a42c (patch) | |
tree | 8adea7d4a40a9521c897bd22db79021724725061 /src/lib/ndpi_classify.c | |
parent | 729ff21d0cbc74cc0b100d95998d59e082b3b2e4 (diff) |
Fixed Mingw64 build.improved/sonarcloud-ci
* adapted to SonarCloud-CI workflow
* removed broken and incomplete Windows example (tested on VS2017/VS2019)
* removed unnecessary include (e.g. pthread.h for the library which does not make use of it)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/ndpi_classify.c')
-rw-r--r-- | src/lib/ndpi_classify.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/ndpi_classify.c b/src/lib/ndpi_classify.c index a7a02cb4e..bea56afef 100644 --- a/src/lib/ndpi_classify.c +++ b/src/lib/ndpi_classify.c @@ -688,7 +688,13 @@ ndpi_log_timestamp(char *log_ts, uint32_t log_ts_len) gettimeofday(&tv, NULL); nowtime = tv.tv_sec; +#ifdef WIN32 + /* localtime() on Windows is thread-safe */ + struct tm * nowtm_r_ptr = localtime(&nowtime); + nowtm_r = *nowtm_r_ptr; +#else localtime_r(&nowtime, &nowtm_r); +#endif strftime(tmbuf, NDPI_TIMESTAMP_LEN, "%H:%M:%S", &nowtm_r); snprintf(log_ts, log_ts_len, "%s.%06ld", tmbuf, (long)tv.tv_usec); } |