aboutsummaryrefslogtreecommitdiff
path: root/contrib/epee
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2017-02-04 17:28:23 +0200
committerRiccardo Spagni <ric@spagni.net>2017-02-04 17:28:23 +0200
commit9547e79af5665b48799c4181ab6c2887e6180e6a (patch)
tree44712a138eb5c774b6702cf4ac2b553cf180203e /contrib/epee
parentMerge pull request #1671 (diff)
parentmlog: probable fix for gmtime_r not being available on windows (diff)
downloadmonero-9547e79af5665b48799c4181ab6c2887e6180e6a.tar.xz
Merge pull request #1670
c3d7a198 mlog: probable fix for gmtime_r not being available on windows (moneromooo-monero)
Diffstat (limited to 'contrib/epee')
-rw-r--r--contrib/epee/src/mlog.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/epee/src/mlog.cpp b/contrib/epee/src/mlog.cpp
index 9266f1891..7f9ef4b3a 100644
--- a/contrib/epee/src/mlog.cpp
+++ b/contrib/epee/src/mlog.cpp
@@ -43,7 +43,12 @@ static std::string generate_log_filename(const char *base)
char tmp[200];
struct tm tm;
time_t now = time(NULL);
- if (!gmtime_r(&now, &tm))
+ if
+#ifdef WIN32
+ (!gmtime_s(&tm, &now))
+#else
+ (!gmtime_r(&now, &tm))
+#endif
strcpy(tmp, "unknown");
else
strftime(tmp, sizeof(tmp), "%Y-%m-%d-%H-%M-%S", &tm);