aboutsummaryrefslogtreecommitdiff
path: root/toys/net
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2020-01-10 14:12:18 -0800
committerRob Landley <rob@landley.net>2020-01-10 20:11:18 -0600
commit24f1f9d145562db4853f1a40ce22ce20274fa730 (patch)
tree04b9010e59854dfe154c967c6651802da4129118 /toys/net
parentd3493991bf5b65c376f40129cfacd566eefe4e2e (diff)
downloadtoybox-24f1f9d145562db4853f1a40ce22ce20274fa730.tar.gz
sntp.c: fix 32-bit.
The epoch was being defined as UL, which is fine for LP64, but too small on LP32 for what we're trying to do. toys/net/sntp.c:60:32: warning: left shift count >= width of type return ((tv.tv_sec+SEVENTIES)<<32)+(((long long)tv.tv_nsec)<<32)/1000000000; ^~ (Android doesn't use this, I'm just fixing this too while I fix the LP64isms I introduced in readelf...)
Diffstat (limited to 'toys/net')
-rw-r--r--toys/net/sntp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/toys/net/sntp.c b/toys/net/sntp.c
index ab6a6031..0cb0b7b4 100644
--- a/toys/net/sntp.c
+++ b/toys/net/sntp.c
@@ -39,7 +39,7 @@ GLOBALS(
)
// Seconds from 1900 to 1970, including appropriate leap days
-#define SEVENTIES 2208988800UL
+#define SEVENTIES 2208988800ULL
// Get time and return ntptime (saving timespec in pointer if not null)
// NTP time is high 32 bits = seconds since 1970 (blame RFC 868), low 32 bits