galeb

Једноставна статичка дистрибуција заснована на musl-у
git clone https://git.sr.ht/~strahinja/galeb
Дневник | Датотеке | Референце | ПРОЧИТАЈМЕ | ЛИЦЕНЦА

0001-posixtz-fix-up-lseek.patch (813B)


      1 From 5c4cd3cee03428636e8d7cc4ed644389a4d598b3 Mon Sep 17 00:00:00 2001
      2 From: William Pitcock <nenolod@dereferenced.org>
      3 Date: Thu, 28 Apr 2011 02:56:42 -0500
      4 Subject: [PATCH] posixtz: ensure the file offset we pass to lseek is off_t
      5 
      6 on 32-bit systems, sizeof(off_t) is 4, on 64-bit sizeof(off_t) is 8
      7 causing a word masking issue.
      8 ---
      9  posixtz.c |    2 +-
     10  1 files changed, 1 insertions(+), 1 deletions(-)
     11 
     12 diff --git a/posixtz.c b/posixtz.c
     13 index cddcb3e..972ca31 100644
     14 --- a/posixtz-0.5/posixtz.c
     15 +++ b/posixtz-0.5/posixtz.c
     16 @@ -36,7 +36,7 @@ char *posix_tz(const char *filename)
     17  	if (r != TZ_BUFLEN
     18  	    || strncmp(buf, "TZif", 4) != 0
     19  	    || (unsigned char)buf[4] < 2
     20 -	    || lseek(fd, -TZ_BUFLEN, SEEK_END) < 0
     21 +	    || lseek(fd, (off_t) -TZ_BUFLEN, SEEK_END) < 0
     22  	   )
     23  		goto ERROR;
     24  
     25 -- 
     26 1.7.4.5
     27