plat unix 64 bit timestamps on 32-bit os
authorImo Farcher <ifar@gmx.net>
Mon, 26 Jan 2015 07:39:36 +0000 (15:39 +0800)
committerAndy Green <andy.green@linaro.org>
Mon, 26 Jan 2015 07:39:36 +0000 (15:39 +0800)
Signed-off-by: Imo Farcher <ifar@gmx.net>
lib/libwebsockets.c
lib/lws-plat-unix.c

index b9be442..56e7ca5 100644 (file)
@@ -721,7 +721,7 @@ LWS_VISIBLE void lwsl_emit_stderr(int level, const char *line)
        for (n = 0; n < LLL_COUNT; n++)
                if (level == (1 << n)) {
                        now = time_in_microseconds() / 100;
-                       sprintf(buf, "[%lu:%04d] %s: ", (unsigned long) now / 10000,
+                       sprintf(buf, "[%llu:%04d] %s: ", (unsigned long long) now / 10000,
                                (int)(now % 10000), log_level_names[n]);
                        break;
                }
index 9af4bdf..1b83187 100644 (file)
@@ -8,7 +8,7 @@ unsigned long long time_in_microseconds(void)
 {
        struct timeval tv;
        gettimeofday(&tv, NULL);
-       return (tv.tv_sec * 1000000) + tv.tv_usec;
+       return ((unsigned long long)tv.tv_sec * 1000000LL) + tv.tv_usec;
 }
 
 LWS_VISIBLE int libwebsockets_get_random(struct libwebsocket_context *context,