Don't try ln again if it failed, it won't have better luck next time.
Unified · Split
| @@ -710,6 +710,7 @@ rm -f $TMPN* $CONFTEST · 709 unmodified lines | |||
| 710 | # --------------------------------------------------------------------------- | 710 | # --------------------------------------------------------------------------- |
| 711 | # build tree in object directory if source path is different from current one | 711 | # build tree in object directory if source path is different from current one |
| 712 | 712 | ||
| 713 | use_cp= | ||
| 713 | fn_makelink() | 714 | fn_makelink() |
| 714 | { | 715 | { |
| 715 | tgt=$1/$2 | 716 | tgt=$1/$2 |
| @@ -726,7 +727,9 @@ fn_makelink() · 10 unmodified lines | |||
| 726 | ;; | 727 | ;; |
| 727 | esac | 728 | esac |
| 728 | 729 | ||
| 729 | ln -sfn "$tgt" $2 || ( echo "ln failed. Using cp instead."; cp -f "$1/$2" $2 ) | 730 | test -n "$use_cp" || ln -sfn "$tgt" $2 || |
| 731 | { use_cp=yes; echo "ln failed. Using cp instead."; } | ||
| 732 | test -z "$use_cp" || cp -f "$1/$2" $2 | ||
| 730 | } | 733 | } |
| 731 | 734 | ||
| 732 | if test "$source_path_used" = "yes" ; then | 735 | if test "$source_path_used" = "yes" ; then |