Date: Wed, 9 Jan 2013 00:22:54 +0000 (UTC) From: Brooks Davis <brooks@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r245198 - projects/mtree/usr.bin/xinstall Message-ID: <201301090022.r090MsSh062137@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: brooks Date: Wed Jan 9 00:22:53 2013 New Revision: 245198 URL: http://svnweb.freebsd.org/changeset/base/245198 Log: When we're making symbolic links and the target is a broken symlink then unlink it rather than trying to link through it since that doesn't work. Modified: projects/mtree/usr.bin/xinstall/xinstall.c Modified: projects/mtree/usr.bin/xinstall/xinstall.c ============================================================================== --- projects/mtree/usr.bin/xinstall/xinstall.c Wed Jan 9 00:01:26 2013 (r245197) +++ projects/mtree/usr.bin/xinstall/xinstall.c Wed Jan 9 00:22:53 2013 (r245198) @@ -726,7 +726,9 @@ install(const char *from_name, const cha devnull = 1; } - target = stat(to_name, &to_sb) == 0; + target = (stat(to_name, &to_sb) == 0); + if (!target && dolink & LN_SYMBOLIC && errno == ELOOP) + target = (lstat(to_name, &to_sb) == 0); if (dolink) { if (target) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301090022.r090MsSh062137>