From ccc11a69def551d0060dbd379cd84b609b837c06 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 cp -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..60e750e 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 || cp -f "$file" "$file~" || { res=$? printf >&2 '%s\n' "$0: cannot backup $i as $i~" continue -- 2.13.5