1 diff -ur cksfv-1.3.orig/src/Makefile cksfv-1.3.LFS/src/Makefile
2 --- cksfv-1.3.orig/src/Makefile 2001-07-06 08:33:08.000000000 +0200
3 +++ cksfv-1.3.LFS/src/Makefile 2004-02-04 23:55:31.000000000 +0100
5 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
8 -CFLAGS+= -Wall -Werror -O2 -g
9 +CFLAGS+= -Wall -Werror -O2 -g -D_LARGEFILE64_SOURCE
10 SRCS= cksfv.c print.c crc32.c readsfv.c newsfv.c
13 diff -ur cksfv-1.3.orig/src/crc32.c cksfv-1.3.LFS/src/crc32.c
14 --- cksfv-1.3.orig/src/crc32.c 2001-07-06 08:33:08.000000000 +0200
15 +++ cksfv-1.3.LFS/src/crc32.c 2004-02-05 00:40:35.000000000 +0100
18 #define BUFFERSIZE 16384 /* (16k) buffer size for reading from the file */
20 -static const unsigned long crctable[256] = {
21 +static const unsigned int crctable[256] = {
22 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba,
23 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3,
24 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988,
29 -int crc32(register int fd, unsigned long *main_val, unsigned long *main_len)
30 +int crc32(register int fd, unsigned int *main_val, unsigned long long *main_len)
32 char buf[BUFFERSIZE], *p;
34 - unsigned long crc = ~0, crc32_total = ~0;
37 + unsigned int crc = ~0, crc32_total = ~0;
39 while ((nr = read(fd, buf, sizeof(buf))) > 0)
40 for (len += nr, p = buf; nr--; ++p) {
41 diff -ur cksfv-1.3.orig/src/newsfv.c cksfv-1.3.LFS/src/newsfv.c
42 --- cksfv-1.3.orig/src/newsfv.c 2001-07-06 08:33:08.000000000 +0200
43 +++ cksfv-1.3.LFS/src/newsfv.c 2004-02-04 23:55:31.000000000 +0100
46 extern void pnsfv_head();
47 extern void pfileinfo(char**);
48 -extern void pcrc(char*, unsigned long);
49 -extern int crc32(int, unsigned long*, unsigned long*);
50 +extern void pcrc(char*, unsigned int);
51 +extern int crc32(int, unsigned int*, unsigned long long*);
53 int newsfv(char **argv)
57 - unsigned long len, val;
58 + unsigned long long len;
66 - if ((fd = open(fn, O_RDONLY, 0)) < 0) {
67 + if ((fd = open(fn, O_RDONLY|O_LARGEFILE, 0)) < 0) {
68 fprintf(stderr, "cksfv: %s: %s\n", fn, strerror(errno));
71 diff -ur cksfv-1.3.orig/src/print.c cksfv-1.3.LFS/src/print.c
72 --- cksfv-1.3.orig/src/print.c 2001-07-06 08:33:08.000000000 +0200
73 +++ cksfv-1.3.LFS/src/print.c 2004-02-04 23:55:31.000000000 +0100
78 -void pcrc(char *fn, unsigned long val)
79 +void pcrc(char *fn, unsigned int val)
81 - printf("%s %.8lX\n", fn, val);
82 + printf("%s %.8X\n", fn, val);
85 void prsfv_head(char *fn)
86 diff -ur cksfv-1.3.orig/src/readsfv.c cksfv-1.3.LFS/src/readsfv.c
87 --- cksfv-1.3.orig/src/readsfv.c 2001-07-06 08:33:08.000000000 +0200
88 +++ cksfv-1.3.LFS/src/readsfv.c 2004-02-04 23:55:31.000000000 +0100
93 -extern int crc32(int, unsigned long*, unsigned long*);
94 +extern int crc32(int, unsigned int*, unsigned long long*);
95 extern void prsfv_head(char*);
97 int find_file(char*, char*);
100 char buf[512], *end, filename[512], crc[9], path[256];
102 - unsigned long len, val, sfvcrc;
103 + unsigned long long len;
104 + unsigned int val, sfvcrc;
109 snprintf(path, 256, "%s/%s", dir, filename);
111 /* can we open the file */
112 - if ((file = open(filename, O_RDONLY, 0)) < 0) {
113 + if ((file = open(filename, O_RDONLY|O_LARGEFILE, 0)) < 0) {
115 /* try to search for it if ingore case is set */
116 find_file(filename, dir);
117 - file = open(filename, O_RDONLY, 0);
118 + file = open(filename, O_RDONLY|O_LARGEFILE, 0);