Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Jun 2017 10:12:54 -0700
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Ngie Cooper <ngie@FreeBSD.org>, src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r320172 - head/bin/ln
Message-ID:  <a3d3114c-8cac-70ab-0441-312a21b7d8cc@FreeBSD.org>
In-Reply-To: <201706202046.v5KKk8Zd034737@repo.freebsd.org>
References:  <201706202046.v5KKk8Zd034737@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--LAipFnno8Ts6IOFjUtMBxLwL5lb3nMHoi
Content-Type: multipart/mixed; boundary="9RK4UkFFQMcbKO84gGXESwA0mt0md2W32";
 protected-headers="v1"
From: Bryan Drewery <bdrewery@FreeBSD.org>
To: Ngie Cooper <ngie@FreeBSD.org>, src-committers@freebsd.org,
 svn-src-all@freebsd.org, svn-src-head@freebsd.org
Message-ID: <a3d3114c-8cac-70ab-0441-312a21b7d8cc@FreeBSD.org>
Subject: Re: svn commit: r320172 - head/bin/ln
References: <201706202046.v5KKk8Zd034737@repo.freebsd.org>
In-Reply-To: <201706202046.v5KKk8Zd034737@repo.freebsd.org>

--9RK4UkFFQMcbKO84gGXESwA0mt0md2W32
Content-Type: text/plain; charset=utf-8
Content-Language: en-US
Content-Transfer-Encoding: quoted-printable

On 6/20/2017 1:46 PM, Ngie Cooper wrote:
> Author: ngie
> Date: Tue Jun 20 20:46:08 2017
> New Revision: 320172
> URL: https://svnweb.freebsd.org/changeset/base/320172
>=20
> Log:
>   ln(1): fix -F behavior
>  =20
>   When '-F' option is used, the target directory needs to be unlinked.
>   Currently, the modified target ("target/source") is being unlinked, a=
nd
>   since it doesn't yet exist, the original target isn't removed.
>   This is fixed by skipping the block where target is modified to
>   "target/source" when '-F' option is set.
>   Hence, a symbolic link (with the same name as of the original target)=
 to
>   the source_file is produced.
>  =20
=3D=3D=3D=3D=3D>   Update the test for ln(1) to reflect fix for option '-=
F'

I don't see a test update here.

>  =20
>   MFC after:	1 month
>   PR:		219943
>   Differential Revision:	D11167
>   Submitted by:	shivansh
>   Sponsored by:	Google (GSoC 2017)
>=20
> Modified:
>   head/bin/ln/ln.c
>=20
> Modified: head/bin/ln/ln.c
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
> --- head/bin/ln/ln.c	Tue Jun 20 20:34:30 2017	(r320171)
> +++ head/bin/ln/ln.c	Tue Jun 20 20:46:08 2017	(r320172)
> @@ -245,11 +245,11 @@ linkit(const char *source, const char *target, in=
t isd
> =20
>  	/*
>  	 * If the target is a directory (and not a symlink if hflag),
> -	 * append the source's name.
> +	 * append the source's name, unless Fflag is set.
>  	 */
> -	if (isdir ||
> +	if (!Fflag && (isdir ||
>  	    (lstat(target, &sb) =3D=3D 0 && S_ISDIR(sb.st_mode)) ||
> -	    (!hflag && stat(target, &sb) =3D=3D 0 && S_ISDIR(sb.st_mode))) {
> +	    (!hflag && stat(target, &sb) =3D=3D 0 && S_ISDIR(sb.st_mode)))) {=

>  		if (strlcpy(bbuf, source, sizeof(bbuf)) >=3D sizeof(bbuf) ||
>  		    (p =3D basename(bbuf)) =3D=3D NULL ||
>  		    snprintf(path, sizeof(path), "%s/%s", target, p) >=3D
>=20


--=20
Regards,
Bryan Drewery


--9RK4UkFFQMcbKO84gGXESwA0mt0md2W32--

--LAipFnno8Ts6IOFjUtMBxLwL5lb3nMHoi
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEcBAEBAgAGBQJZSqkWAAoJEDXXcbtuRpfPhmkH/jYM9VQ3HI+OiqanK95VhwJG
ybqky+T18ANmewb2WJdaEoznDHb95mryvVtWl+0EgIPb6ohsFcF+IsTXpYVErRjg
TvKkJQ7Oc3t26g5gmxnOO3AELTf5Cp7zrhaEa/TqIaiRe3+oS3xhUB0ZsMBN5YoD
4ty0GD5cX7zU5b1HwlC46MkfV88gf+hjWwFF+UHvfQ86Nz8Aw+9n+AG+BGDbllpr
neMEjSEom0NcRoL6qiL9ozksJjfJYC0U2ujRK1eVM1+VdXLtHJ+I4kL7OPpWwGa6
9lT2qq50gOWUkBpe+gzE4G+3v+U9sxZDuH4PwO75wpzN29MjZROpmmLVHPMllkM=
=/Efy
-----END PGP SIGNATURE-----

--LAipFnno8Ts6IOFjUtMBxLwL5lb3nMHoi--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a3d3114c-8cac-70ab-0441-312a21b7d8cc>