From 5cabd60586706bd860e24a6e875d3f177ba3524d Mon Sep 17 00:00:00 2001 From: William Pitcock Date: Thu, 28 Apr 2011 02:59:17 -0500 Subject: main/tzdata: stdio hack not needed, was a wordmasking issue --- main/tzdata/0001-posixtz-fix-up-lseek.patch | 54 +++++++++-------------------- main/tzdata/APKBUILD | 2 +- 2 files changed, 18 insertions(+), 38 deletions(-) (limited to 'main') diff --git a/main/tzdata/0001-posixtz-fix-up-lseek.patch b/main/tzdata/0001-posixtz-fix-up-lseek.patch index c5b0c74a0..1db3eba9e 100644 --- a/main/tzdata/0001-posixtz-fix-up-lseek.patch +++ b/main/tzdata/0001-posixtz-fix-up-lseek.patch @@ -1,47 +1,27 @@ +From 5c4cd3cee03428636e8d7cc4ed644389a4d598b3 Mon Sep 17 00:00:00 2001 +From: William Pitcock +Date: Thu, 28 Apr 2011 02:56:42 -0500 +Subject: [PATCH] posixtz: ensure the file offset we pass to lseek is off_t + +on 32-bit systems, sizeof(off_t) is 4, on 64-bit sizeof(off_t) is 8 +causing a word masking issue. +--- + posixtz.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + diff --git a/posixtz.c b/posixtz.c -index 141cca1..604a53d 100644 +index cddcb3e..972ca31 100644 --- a/posixtz-0.3/posixtz.c +++ b/posixtz-0.3/posixtz.c -@@ -25,18 +25,19 @@ - - char *posix_tz(const char *filename) - { -- int fd, r; -+ FILE *f; -+ size_t r; - static char buf[TZ_BUFLEN]; - char *p = NULL; -- fd = open(filename, O_RDONLY); -- if (fd < 0) -+ f = fopen(filename, "r"); -+ if (f == NULL) - return NULL; - -- r = read(fd, buf, TZ_BUFLEN); -+ r = fread(buf, 1, TZ_BUFLEN, f); +@@ -36,7 +36,7 @@ char *posix_tz(const char *filename) if (r != TZ_BUFLEN || strncmp(buf, "TZif", 4) != 0 || (unsigned char)buf[4] < 2 - || lseek(fd, -TZ_BUFLEN, SEEK_END) < 0 -+ || fseek(f, -TZ_BUFLEN, SEEK_END) < 0 ++ || lseek(fd, (off_t) -TZ_BUFLEN, SEEK_END) < 0 ) goto ERROR; -@@ -50,7 +51,7 @@ char *posix_tz(const char *filename) - ** (with nothing between the newlines if there is no POSIX representation for - ** such instants). - */ -- r = read(fd, buf, TZ_BUFLEN); -+ r = fread(buf, 1, TZ_BUFLEN, f); - if (r <= 0 || buf[--r] != '\n') - goto ERROR; - buf[r] = 0; -@@ -61,7 +62,7 @@ char *posix_tz(const char *filename) - } - } /* else ('\n' not found): p remains NULL */ - ERROR: -- close(fd); -+ fclose(f); - return p; - } - +-- +1.7.4.5 + diff --git a/main/tzdata/APKBUILD b/main/tzdata/APKBUILD index 975de9791..e5227e53e 100644 --- a/main/tzdata/APKBUILD +++ b/main/tzdata/APKBUILD @@ -3,7 +3,7 @@ pkgname=tzdata pkgver=2011e _ptzver=0.3 -pkgrel=1 +pkgrel=2 pkgdesc="Timezone data" url="http://www.twinsun.com/tz/tz-link.htm" arch="all" -- cgit v1.2.3