diff -ru tar-1.25.orig/src/extract.c tar-1.25/src/extract.c --- tar-1.25.orig/src/extract.c 2011-01-31 09:18:13 +0100 +++ tar-1.25/src/extract.c 2011-01-31 09:14:09 +0100 @@ -1002,12 +1002,6 @@ if (to_stdout_option) return 0; - if (! to_command_option) - set_stat (file_name, ¤t_stat_info, fd, - current_mode, current_mode_mask, typeflag, false, - (old_files_option == OVERWRITE_OLD_FILES - ? 0 : AT_SYMLINK_NOFOLLOW)); - status = close (fd); if (status < 0) close_error (file_name); @@ -1015,6 +1009,12 @@ if (to_command_option) sys_wait_command (); + if (! to_command_option) + set_stat (file_name, ¤t_stat_info, -1, + current_mode, current_mode_mask, typeflag, false, + (old_files_option == OVERWRITE_OLD_FILES + ? 0 : AT_SYMLINK_NOFOLLOW)); + return status; }