From 4692fd80d5dc42bce426429917657d7a59772d94 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Tue, 14 Nov 2017 19:34:46 -0800 Subject: [PATCH] gzexe: work even without the ability to make a hard link * gzexe.in: When ln -f fails to create a "~"-style backup, fall back to using mv -f. Reported by Bruno Haible in http://debbugs.gnu.org/29266 --- gzexe.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gzexe.in b/gzexe.in index 290fa1c..721aba4 100644 --- a/gzexe.in +++ b/gzexe.in @@ -213,7 +213,7 @@ EOF printf >&2 '%s\n' "$0: $tmp: cannot chmod" continue } - ln -f "$file" "$file~" || { + ln -f "$file" "$file~" 2>/dev/null || mv -f "$file" "$file~" || { res=$? printf >&2 '%s\n' "$0: cannot backup $i as $i~" continue -- 2.30.2