wok rev 14151
syslinux/isohybrid.exe: lseek fix
author | Pascal Bellard <pascal.bellard@slitaz.org> |
---|---|
date | Mon Mar 04 10:03:54 2013 +0100 (2013-03-04) |
parents | a26ba54f3ea7 |
children | 9050e21d61bc |
files | syslinux/stuff/iso2exe/iso2exe.c |
line diff
1.1 --- a/syslinux/stuff/iso2exe/iso2exe.c Mon Mar 04 09:52:12 2013 +0100 1.2 +++ b/syslinux/stuff/iso2exe/iso2exe.c Mon Mar 04 10:03:54 2013 +0100 1.3 @@ -57,7 +57,7 @@ 1.4 * (unsigned long *) &bootiso[512 + 440] = rand(); 1.5 * (unsigned long *) &bootiso[512 + partition] = 0x10080; 1.6 * (unsigned short *) &bootiso[512 + 510] = 0xAA55; 1.7 - size = lseek(fd, 0, SEEK_END); 1.8 + size = lseek(fd, 0UL, SEEK_END); 1.9 cylinders = (size + trksz - 1) / trksz; 1.10 bootiso[512 + partition + 4] = 23; // "Windows hidden IFS" 1.11 bootiso[512 + partition + 5] = heads - 1; 1.12 @@ -71,13 +71,13 @@ 1.13 * (unsigned short *) (bootiso + 26) = rand(); 1.14 1.15 // Update iso image 1.16 - lseek(fd, 0, SEEK_SET); 1.17 + lseek(fd, 0UL, SEEK_SET); 1.18 write(fd, bootiso, 1024); 1.19 - lseek(fd, 0x8400 - BOOTISOSZ, SEEK_SET); 1.20 + lseek(fd, 0x8400UL - BOOTISOSZ, SEEK_SET); 1.21 write(fd, bootiso + 1024, BOOTISOSZ - 1024); 1.22 1.23 // Compute the checksum 1.24 - lseek(fd, 0, SEEK_SET); 1.25 + lseek(fd, 0UL, SEEK_SET); 1.26 for (i = 66, n = 0, j = 0; j < 16; j++, i = 0) { 1.27 if (read(fd, buffer, sizeof(buffer)) != sizeof(buffer)) 1.28 goto nochksum; 1.29 @@ -85,7 +85,7 @@ 1.30 n += * (unsigned short *) (buffer + i); 1.31 } 1.32 * (unsigned short *) (bootiso + 64) = -n; 1.33 - lseek(fd, 0, SEEK_SET); 1.34 + lseek(fd, 0UL, SEEK_SET); 1.35 write(fd, bootiso, 512); 1.36 nochksum: 1.37 close(fd);