]> Dogcows Code - chaz/tar/commitdiff
Minor bugfixes
authorSergey Poznyakoff <gray@gnu.org.ua>
Thu, 9 Jan 2014 15:22:08 +0000 (17:22 +0200)
committerSergey Poznyakoff <gray@gnu.org.ua>
Thu, 9 Jan 2014 15:24:21 +0000 (17:24 +0200)
* src/compare.c (diff_dumpdir): Close descriptor if fstat failed.
(diff_multivol): Make sure the descriptor is closed and eventual
errors reported if lseek fails.
Both reported by Jiri Kukacka.

src/compare.c

index 407fd4016952a7eed858092f19f257c5e82d50fc..3bd0f07e0d0671409ff2fb556e2f6be4427c22ee 100644 (file)
@@ -371,7 +371,10 @@ diff_dumpdir (struct tar_stat_info *dir)
       if (fd < 0)
        diag = open_diag;
       else if (fstat (fd, &dir->stat))
-       diag = stat_diag;
+        {
+         diag = stat_diag;
+          close (fd);
+        }
       else
        dir->fd = fd;
       if (diag)
@@ -439,10 +442,9 @@ diff_multivol (void)
     {
       seek_error_details (current_stat_info.file_name, offset);
       report_difference (&current_stat_info, NULL);
-      return;
     }
-
-  read_and_process (&current_stat_info, process_rawdata);
+  else
+    read_and_process (&current_stat_info, process_rawdata);
 
   status = close (fd);
   if (status != 0)
This page took 0.022817 seconds and 4 git commands to generate.