]>
Commit | Line | Data |
---|---|---|
6e482312 | 1 | diff -ur cksfv-1.3.orig/src/Makefile cksfv-1.3.LFS/src/Makefile |
31751cd2 | 2 | --- cksfv-1.3.orig/src/Makefile 2001-07-06 08:33:08.000000000 +0200 |
6e482312 | 3 | +++ cksfv-1.3.LFS/src/Makefile 2004-02-04 23:55:31.000000000 +0100 |
31751cd2 JR |
4 | @@ -17,7 +17,7 @@ |
5 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
6 | ||
7 | PROG= cksfv | |
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 | |
11 | ||
12 | cksfv: $(SRCS) | |
6e482312 JR |
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 | |
16 | @@ -23,7 +23,7 @@ | |
17 | ||
18 | #define BUFFERSIZE 16384 /* (16k) buffer size for reading from the file */ | |
19 | ||
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, | |
25 | @@ -91,11 +91,12 @@ | |
26 | }; | |
27 | ||
28 | ||
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) | |
31 | { | |
32 | char buf[BUFFERSIZE], *p; | |
33 | - int len = 0, nr; | |
34 | - unsigned long crc = ~0, crc32_total = ~0; | |
35 | + long long len = 0; | |
36 | + int nr; | |
37 | + unsigned int crc = ~0, crc32_total = ~0; | |
38 | ||
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 | |
44 | @@ -24,21 +24,22 @@ | |
45 | ||
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*); | |
52 | ||
53 | int newsfv(char **argv) | |
54 | { | |
55 | int fd, rval = 0; | |
56 | char *fn; | |
57 | - unsigned long len, val; | |
58 | + unsigned long long len; | |
59 | + unsigned int val; | |
60 | ||
61 | pnsfv_head(); | |
62 | pfileinfo(argv); | |
31751cd2 JR |
63 | |
64 | while (*argv) { | |
65 | fn = *argv++; | |
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)); | |
69 | rval = 1; | |
70 | continue; | |
6e482312 JR |
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 | |
74 | @@ -59,9 +59,9 @@ | |
75 | } | |
76 | } | |
77 | ||
78 | -void pcrc(char *fn, unsigned long val) | |
79 | +void pcrc(char *fn, unsigned int val) | |
80 | { | |
81 | - printf("%s %.8lX\n", fn, val); | |
82 | + printf("%s %.8X\n", fn, val); | |
83 | } | |
84 | ||
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 | |
89 | @@ -28,7 +28,7 @@ | |
90 | #include <dirent.h> | |
91 | #include <stdlib.h> | |
92 | ||
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*); | |
96 | ||
97 | int find_file(char*, char*); | |
98 | @@ -39,7 +39,8 @@ | |
99 | FILE *fd; | |
100 | char buf[512], *end, filename[512], crc[9], path[256]; | |
101 | int file, rval = 0; | |
102 | - unsigned long len, val, sfvcrc; | |
103 | + unsigned long long len; | |
104 | + unsigned int val, sfvcrc; | |
105 | ||
106 | if (quiet == 0) { | |
107 | prsfv_head(fn); | |
108 | @@ -79,11 +80,11 @@ | |
31751cd2 JR |
109 | snprintf(path, 256, "%s/%s", dir, filename); |
110 | ||
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) { | |
114 | if (nocase == 1) { | |
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); | |
119 | } | |
120 | } | |
121 |