Răsfoiți Sursa

Minor bugfixes

* 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.
Sergey Poznyakoff 11 ani în urmă
părinte
comite
481572c63f
1 a modificat fișierele cu 6 adăugiri și 4 ștergeri
  1. 6 4
      src/compare.c

+ 6 - 4
src/compare.c

@@ -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)