[Spice-devel] [PATCH usbclerk 1/6] vdlog.h: do not use Windows specific time functions

Marc-André Lureau marcandre.lureau at gmail.com
Tue Feb 19 02:35:26 PST 2013


From: Uri Lublin <uril at redhat.com>

---
 vdlog.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/vdlog.h b/vdlog.h
index 5a794b6..9fc2cec 100644
--- a/vdlog.h
+++ b/vdlog.h
@@ -61,11 +61,11 @@ static unsigned int log_level = LOG_INFO;
     VDLog* log = VDLog::get();                                                                  \
     const char *type_as_char[] = { "DEBUG", "INFO", "WARN", "ERROR", "FATAL" };                 \
     struct _timeb now;                                                                          \
-    struct tm today;                                                                            \
+    struct tm *today;                                                                            \
     char datetime_str[20];                                                                      \
-    _ftime_s(&now);                                                                             \
-    localtime_s(&today, &now.time);                                                             \
-    strftime(datetime_str, 20, "%Y-%m-%d %H:%M:%S", &today);                                    \
+    _ftime(&now);                                                                             \
+    today = localtime(&now.time);                                                             \
+    strftime(datetime_str, 20, "%Y-%m-%d %H:%M:%S", today);                                    \
     if (log) {                                                                                  \
         log->PRINT_LINE(type_as_char[type], format, datetime_str, now.millitm, ## __VA_ARGS__); \
     } else {                                                                                    \
-- 
1.8.1.1.439.g50a6b54



More information about the Spice-devel mailing list