From 97a748a2d006ee00813d282d3142092b59918ec2 Mon Sep 17 00:00:00 2001 From: Imo Farcher Date: Mon, 26 Jan 2015 15:39:36 +0800 Subject: [PATCH] plat unix 64 bit timestamps on 32-bit os Signed-off-by: Imo Farcher --- lib/libwebsockets.c | 2 +- lib/lws-plat-unix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index b9be442..56e7ca5 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -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; } diff --git a/lib/lws-plat-unix.c b/lib/lws-plat-unix.c index 9af4bdf..1b83187 100644 --- a/lib/lws-plat-unix.c +++ b/lib/lws-plat-unix.c @@ -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, -- 2.7.4