Deleted Added
full compact
mkctm.c (19912) mkctm.c (21786)
1/* Still missing:
2 *
3 * mkctm
4 * -B regex Bogus
5 * -I regex Ignore
6 * -D int Damage
7 * -q decrease verbosity
8 * -v increase verbosity

--- 165 unchanged lines hidden (view full) ---

174 s_same_files++;
175 s_same_bytes += s1.st_size;
176 close(fd1);
177 close(fd2);
178 goto finish;
179 }
180#endif
181 p1=mmap(0, s1.st_size, PROT_READ, MAP_PRIVATE, fd1, 0);
1/* Still missing:
2 *
3 * mkctm
4 * -B regex Bogus
5 * -I regex Ignore
6 * -D int Damage
7 * -q decrease verbosity
8 * -v increase verbosity

--- 165 unchanged lines hidden (view full) ---

174 s_same_files++;
175 s_same_bytes += s1.st_size;
176 close(fd1);
177 close(fd2);
178 goto finish;
179 }
180#endif
181 p1=mmap(0, s1.st_size, PROT_READ, MAP_PRIVATE, fd1, 0);
182 if ((int)p1 == -1) { perror(buf1); exit(3); }
182 if (p1 == (u_char *)MAP_FAILED) { perror(buf1); exit(3); }
183 close(fd1);
184
185 p2=mmap(0, s2.st_size, PROT_READ, MAP_PRIVATE, fd2, 0);
183 close(fd1);
184
185 p2=mmap(0, s2.st_size, PROT_READ, MAP_PRIVATE, fd2, 0);
186 if ((int)p2 == -1) { perror(buf2); exit(3); }
186 if (p2 == (u_char *)MAP_FAILED) { perror(buf2); exit(3); }
187 close(fd2);
188
189 /* If identical, we're done. */
190 if((s1.st_size == s2.st_size) && !memcmp(p1, p2, s1.st_size)) {
191 s_same_files++;
192 s_same_bytes += s1.st_size;
193 goto finish;
194 }

--- 122 unchanged lines hidden (view full) ---

317
318 strcpy(buf2, dir2);
319 strcat(buf2, "/"); strcat(buf2, name);
320 strcat(buf2, "/"); strcat(buf2, de->d_name);
321 fd1 = open(buf2, O_RDONLY);
322 if (fd1 < 0) {perror(buf2); exit (3); }
323 fstat(fd1, &st);
324 p1=mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd1, 0);
187 close(fd2);
188
189 /* If identical, we're done. */
190 if((s1.st_size == s2.st_size) && !memcmp(p1, p2, s1.st_size)) {
191 s_same_files++;
192 s_same_bytes += s1.st_size;
193 goto finish;
194 }

--- 122 unchanged lines hidden (view full) ---

317
318 strcpy(buf2, dir2);
319 strcat(buf2, "/"); strcat(buf2, name);
320 strcat(buf2, "/"); strcat(buf2, de->d_name);
321 fd1 = open(buf2, O_RDONLY);
322 if (fd1 < 0) {perror(buf2); exit (3); }
323 fstat(fd1, &st);
324 p1=mmap(0, st.st_size, PROT_READ, MAP_PRIVATE, fd1, 0);
325 if ((int)p1 == -1) { perror(buf2); exit(3); }
325 if (p1 == (u_char *)MAP_FAILED) { perror(buf2); exit(3); }
326 close(fd1);
327 m2 = MD5Data(p1, st.st_size, md5_2);
328 name_stat("CTMFM", dir2, name, de);
329 printf(" %s %u\n", m2, (unsigned)st.st_size);
330 fwrite(p1, 1, st.st_size, stdout);
331 putchar('\n');
332 munmap(p1, st.st_size);
333 s_new_files++;

--- 261 unchanged lines hidden ---
326 close(fd1);
327 m2 = MD5Data(p1, st.st_size, md5_2);
328 name_stat("CTMFM", dir2, name, de);
329 printf(" %s %u\n", m2, (unsigned)st.st_size);
330 fwrite(p1, 1, st.st_size, stdout);
331 putchar('\n');
332 munmap(p1, st.st_size);
333 s_new_files++;

--- 261 unchanged lines hidden ---