summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2014-01-09 17:22:08 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2014-01-09 17:24:21 +0200
commit481572c63f5a259f1338a1b74e2dee304bd0df0b (patch)
tree411803eccf4c9c5acbf7f4a82e44dbb1d78ec74a
parent47da28892e6860a3a6fc06745f640e3bb878c757 (diff)
downloadtar-481572c63f5a259f1338a1b74e2dee304bd0df0b.tar.gz
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.
-rw-r--r--src/compare.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/compare.c b/src/compare.c
index 407fd401..3bd0f07e 100644
--- a/src/compare.c
+++ b/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)