- really_dir:
- if (incremental_option)
- {
- /* Read the entry and delete files that aren't listed in the
- archive. */
-
- purge_directory (file_name);
- }
- else if (typeflag == GNUTYPE_DUMPDIR)
- skip_member ();
-
- mode = ((current_stat_info.stat.st_mode
- | (we_are_root ? 0 : MODE_WXUSR))
- & MODE_RWX);
-
- status = prepare_to_extract (file_name);
- if (status == 0)
- break;
- if (status < 0)
- goto directory_exists;
-
- again_dir:
- status = mkdir (file_name, mode);
-
- if (status != 0)
- {
- if (errno == EEXIST
- && (interdir_made
- || old_files_option == DEFAULT_OLD_FILES
- || old_files_option == OVERWRITE_OLD_FILES))
- {
- struct stat st;
- if (stat (file_name, &st) == 0)
- {
- if (interdir_made)
- {
- repair_delayed_set_stat (file_name, &st);
- break;
- }
- if (S_ISDIR (st.st_mode))
- {
- mode = st.st_mode & ~ current_umask;
- goto directory_exists;
- }
- }
- errno = EEXIST;
- }
-
- if (maybe_recoverable (file_name, &interdir_made))
- goto again_dir;
-
- if (errno != EEXIST)
- {
- mkdir_error (file_name);
- if (backup_option)
- undo_last_backup ();
- break;
- }
- }
-
- directory_exists:
- if (status == 0
- || old_files_option == DEFAULT_OLD_FILES
- || old_files_option == OVERWRITE_OLD_FILES)
- delay_set_stat (file_name, ¤t_stat_info.stat,
- MODE_RWX & (mode ^ current_stat_info.stat.st_mode),
- (status == 0
- ? ARCHIVED_PERMSTATUS
- : UNKNOWN_PERMSTATUS));