X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcompare.c;h=b74793fc7e07f203af6918add5b8d80b83c8242e;hb=59146768ef4a2c045239628b7179ea477563d63f;hp=9385d40940c2de3fc75cc55ba069e999282c0139;hpb=166b7c7d028c3dbcfded5c834b9bf752d2fb41f0;p=chaz%2Ftar diff --git a/src/compare.c b/src/compare.c index 9385d40..b74793f 100644 --- a/src/compare.c +++ b/src/compare.c @@ -122,7 +122,7 @@ read_and_process (struct tar_stat_info *st, int (*processor) (size_t, char *)) size_t data_size; off_t size = st->stat.st_size; - mv_begin (st); + mv_begin_read (st); while (size) { data_block = find_next_block (); @@ -217,12 +217,7 @@ diff_file (void) } else { - int atime_flag = - (atime_preserve_option == system_atime_preserve - ? O_NOATIME - : 0); - - diff_handle = open (file_name, O_RDONLY | O_BINARY | atime_flag); + diff_handle = open (file_name, open_read_flags); if (diff_handle < 0) { @@ -331,7 +326,7 @@ static int dumpdir_cmp (const char *a, const char *b) { size_t len; - + while (*a) switch (*a) { @@ -345,7 +340,7 @@ dumpdir_cmp (const char *a, const char *b) a += len; b += len; break; - + case 'D': if (strcmp(a, b)) return 1; @@ -353,7 +348,7 @@ dumpdir_cmp (const char *a, const char *b) a += len; b += len; break; - + case 'R': case 'T': case 'X': @@ -379,8 +374,7 @@ diff_dumpdir (void) else dev = stat_data.st_dev; - dumpdir_buffer = directory_contents - (scan_directory (current_stat_info.file_name, dev, false)); + dumpdir_buffer = directory_contents (scan_directory (¤t_stat_info)); if (dumpdir_buffer) { @@ -422,7 +416,7 @@ diff_multivol (void) return; } - fd = open (current_stat_info.file_name, O_RDONLY | O_BINARY); + fd = open (current_stat_info.file_name, open_read_flags); if (fd < 0) { @@ -452,7 +446,6 @@ diff_archive (void) { set_next_block_after (current_header); - decode_header (current_header, ¤t_stat_info, ¤t_format, 1); /* Print the block from current_header and current_stat_info. */ @@ -578,8 +571,9 @@ verify_volume (void) flush_read (); while (1) { - enum read_header status = read_header (¤t_header, - ¤t_stat_info, false); + enum read_header status = read_header (¤t_header, + ¤t_stat_info, + read_header_auto); if (status == HEADER_FAILURE) { @@ -590,7 +584,7 @@ verify_volume (void) counter++; set_next_block_after (current_header); status = read_header (¤t_header, ¤t_stat_info, - false); + read_header_auto); } while (status == HEADER_FAILURE); @@ -608,7 +602,8 @@ verify_volume (void) { char buf[UINTMAX_STRSIZE_BOUND]; - status = read_header (¤t_header, ¤t_stat_info, false); + status = read_header (¤t_header, ¤t_stat_info, + read_header_auto); if (status == HEADER_ZERO_BLOCK) break; WARNOPT (WARN_ALONE_ZERO_BLOCK, @@ -616,7 +611,7 @@ verify_volume (void) STRINGIFY_BIGINT (current_block_ordinal (), buf))); } } - + diff_archive (); tar_stat_destroy (¤t_stat_info); }