]> Dogcows Code - chaz/tar/blobdiff - src/compare.c
tar: more reliable directory traversal when creating archives
[chaz/tar] / src / compare.c
index ffadc24a942e03563ab8706468b6a6d52f00fbcf..b74793fc7e07f203af6918add5b8d80b83c8242e 100644 (file)
@@ -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 (&current_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)
     {
@@ -577,8 +571,8 @@ verify_volume (void)
   flush_read ();
   while (1)
     {
-      enum read_header status = read_header (&current_header, 
-                                             &current_stat_info, 
+      enum read_header status = read_header (&current_header,
+                                             &current_stat_info,
                                              read_header_auto);
 
       if (status == HEADER_FAILURE)
@@ -608,7 +602,7 @@ verify_volume (void)
             {
              char buf[UINTMAX_STRSIZE_BOUND];
 
-             status = read_header (&current_header, &current_stat_info, 
+             status = read_header (&current_header, &current_stat_info,
                                    read_header_auto);
              if (status == HEADER_ZERO_BLOCK)
                break;
@@ -617,7 +611,7 @@ verify_volume (void)
                        STRINGIFY_BIGINT (current_block_ordinal (), buf)));
             }
        }
-      
+
       diff_archive ();
       tar_stat_destroy (&current_stat_info);
     }
This page took 0.025598 seconds and 4 git commands to generate.