* 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.
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)
{
seek_error_details (current_stat_info.file_name, offset);
report_difference (¤t_stat_info, NULL);
- return;
}
-
- read_and_process (¤t_stat_info, process_rawdata);
+ else
+ read_and_process (¤t_stat_info, process_rawdata);
status = close (fd);
if (status != 0)