aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLasse Collin <lasse.collin@tukaani.org>2022-10-25 18:23:54 +0300
committerLasse Collin <lasse.collin@tukaani.org>2022-11-11 13:29:13 +0200
commit23b7416d5ba0e3579265467bd546865d2ea4cef0 (patch)
tree51961d8e146a5ad0c1538f26061c11320479e8a2
parenttuklib_cpucores: Use HW_NCPUONLINE on OpenBSD. (diff)
downloadxz-23b7416d5ba0e3579265467bd546865d2ea4cef0.tar.xz
xz: If input file cannot be removed, treat it as a warning, not error.
Treating it as a warning (message + exit status 2) matches gzip and it seems more logical as at that point the output file has already been successfully closed. When it's a warning it is possible to suppress it with --no-warn.
-rw-r--r--src/xz/file_io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/xz/file_io.c b/src/xz/file_io.c
index 01abc1ba..76b1967e 100644
--- a/src/xz/file_io.c
+++ b/src/xz/file_io.c
@@ -330,14 +330,14 @@ io_unlink(const char *name, const struct stat *known_st)
// it is possible that the user has put a new file in place
// of the original file, and in that case it obviously
// shouldn't be removed.
- message_error(_("%s: File seems to have been moved, "
+ message_warning(_("%s: File seems to have been moved, "
"not removing"), name);
else
#endif
// There's a race condition between lstat() and unlink()
// but at least we have tried to avoid removing wrong file.
if (unlink(name))
- message_error(_("%s: Cannot remove: %s"),
+ message_warning(_("%s: Cannot remove: %s"),
name, strerror(errno));
return;