From: Sergey Poznyakoff Date: Sun, 12 Sep 2004 12:50:31 +0000 (+0000) Subject: Normalized use of remove_any_file(). X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=75bf036edc1425eb66dcc9623846c7204f943ce6;p=chaz%2Ftar Normalized use of remove_any_file(). --- diff --git a/src/extract.c b/src/extract.c index 214d975..f348b82 100644 --- a/src/extract.c +++ b/src/extract.c @@ -462,7 +462,9 @@ prepare_to_extract (char const *file_name) switch (old_files_option) { case UNLINK_FIRST_OLD_FILES: - if (!remove_any_file (file_name, recursive_unlink_option) + if (!remove_any_file (file_name, + recursive_unlink_option ? RECURSIVE_REMOVE_OPTION + : ORDINARY_REMOVE_OPTION) && errno && errno != ENOENT) { unlink_error (file_name); @@ -519,7 +521,7 @@ maybe_recoverable (char *file_name, int *interdir_made) case NO_OVERWRITE_DIR_OLD_FILES: case OVERWRITE_OLD_FILES: { - int r = remove_any_file (file_name, 0); + int r = remove_any_file (file_name, ORDINARY_REMOVE_OPTION); errno = EEXIST; return r; } diff --git a/src/misc.c b/src/misc.c index 51561e4..bead680 100644 --- a/src/misc.c +++ b/src/misc.c @@ -317,7 +317,8 @@ remove_any_file (const char *file_name, enum remove_option option) entry += entrylen + 1) { char *file_name_buffer = new_name (file_name, entry); - int r = remove_any_file (file_name_buffer, 1); + int r = remove_any_file (file_name_buffer, + RECURSIVE_REMOVE_OPTION); int e = errno; free (file_name_buffer);