From owner-svn-src-head@freebsd.org Wed Jun 21 17:13:01 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C691BD94286; Wed, 21 Jun 2017 17:13:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2610:1c1:1:6074::16:84]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "freefall.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 986CC747A7; Wed, 21 Jun 2017 17:13:01 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (unknown [127.0.1.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by freefall.freebsd.org (Postfix) with ESMTPS id C8CE74296; Wed, 21 Jun 2017 17:13:00 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mail.xzibition.com (localhost [172.31.3.2]) by mail.xzibition.com (Postfix) with ESMTP id 8C58E9FA5; Wed, 21 Jun 2017 17:12:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at mail.xzibition.com Received: from mail.xzibition.com ([172.31.3.2]) by mail.xzibition.com (mail.xzibition.com [172.31.3.2]) (amavisd-new, port 10026) with LMTP id P5XIZTn6AqDT; Wed, 21 Jun 2017 17:12:55 +0000 (UTC) Subject: Re: svn commit: r320172 - head/bin/ln DKIM-Filter: OpenDKIM Filter v2.9.2 mail.xzibition.com 7CE589F9E To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201706202046.v5KKk8Zd034737@repo.freebsd.org> From: Bryan Drewery Openpgp: id=F9173CB2C3AAEA7A5C8A1F0935D771BB6E4697CF; url=http://www.shatow.net/bryan/bryan2.asc Organization: FreeBSD Message-ID: Date: Wed, 21 Jun 2017 10:12:54 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <201706202046.v5KKk8Zd034737@repo.freebsd.org> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="LAipFnno8Ts6IOFjUtMBxLwL5lb3nMHoi" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jun 2017 17:13:01 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --LAipFnno8Ts6IOFjUtMBxLwL5lb3nMHoi Content-Type: multipart/mixed; boundary="9RK4UkFFQMcbKO84gGXESwA0mt0md2W32"; protected-headers="v1" From: Bryan Drewery To: Ngie Cooper , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Message-ID: 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--