summaryrefslogtreecommitdiffstats
path: root/main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
diff options
context:
space:
mode:
authorWilliam Pitcock <nenolod@dereferenced.org>2011-04-28 03:18:03 -0500
committerWilliam Pitcock <nenolod@dereferenced.org>2011-04-28 03:18:03 -0500
commit5a5a78dc90df3cefb1c9cce93c308054a0e2114c (patch)
tree89b2914a75951146e6749e9b2bfd63f0f6572cc0 /main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
parent343f0956f9661bba5fd74cef91eea8c21040fa95 (diff)
downloadaports-5a5a78dc90df3cefb1c9cce93c308054a0e2114c.tar.bz2
aports-5a5a78dc90df3cefb1c9cce93c308054a0e2114c.tar.xz
main/libc0.9.32: make /etc/localtime work
Diffstat (limited to 'main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch')
-rw-r--r--main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch b/main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
new file mode 100644
index 000000000..e47d89620
--- /dev/null
+++ b/main/libc0.9.32/0001-time-fix-parsing-of-tzdata-files-where-off_t-is-64-b.patch
@@ -0,0 +1,32 @@
+From ef44545eb332eac26577ea2672e89b01b3aa5706 Mon Sep 17 00:00:00 2001
+From: William Pitcock <nenolod@dereferenced.org>
+To: uclibc@uclibc.org
+Date: Thu, 28 Apr 2011 03:09:20 -0500
+Subject: [PATCH] time: fix parsing of tzdata files where off_t is 64-bit
+
+lseek takes off_t as the offset type, but gcc will normally pass a
+32-bit value unless the number is wider than 16 bits. so we force
+gcc to pass the constant as off_t type always by casting the constant
+to off_t.
+
+Signed-off-by: William Pitcock <nenolod@dereferenced.org>
+---
+ libc/misc/time/time.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
+index 19d68e1..1b21f9e 100644
+--- a/libc/misc/time/time.c
++++ b/libc/misc/time/time.c
+@@ -1856,7 +1856,7 @@ ERROR:
+ if (r != TZ_BUFLEN
+ || strncmp(buf, "TZif", 4) != 0
+ || (unsigned char)buf[4] < 2
+- || lseek(fd, -TZ_BUFLEN, SEEK_END) < 0
++ || lseek(fd, (off_t) -TZ_BUFLEN, SEEK_END) < 0
+ ) {
+ goto ERROR;
+ }
+--
+1.7.4.5
+