From: Jim Meyering Date: Wed, 15 Nov 2017 03:34:46 +0000 (-0800) Subject: gzexe: work even without the ability to make a hard link X-Git-Tag: v1.9~7 X-Git-Url: https://git.gag.com/?a=commitdiff_plain;ds=sidebyside;h=4692fd80d5dc42bce426429917657d7a59772d94;p=debian%2Fgzip 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 --- 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