From owner-freebsd-current@freebsd.org Fri Feb 10 14:46:17 2017 Return-Path: Delivered-To: freebsd-current@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 3BB53CD8139 for ; Fri, 10 Feb 2017 14:46:17 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from mailman.ysv.freebsd.org (mailman.ysv.freebsd.org [IPv6:2001:1900:2254:206a::50:5]) by mx1.freebsd.org (Postfix) with ESMTP id 2414F1A2 for ; Fri, 10 Feb 2017 14:46:17 +0000 (UTC) (envelope-from david@catwhisker.org) Received: by mailman.ysv.freebsd.org (Postfix) id 23664CD8137; Fri, 10 Feb 2017 14:46:17 +0000 (UTC) Delivered-To: current@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 230A5CD8136 for ; Fri, 10 Feb 2017 14:46:17 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (mx.catwhisker.org [198.144.209.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id CC0FC1A1 for ; Fri, 10 Feb 2017 14:46:16 +0000 (UTC) (envelope-from david@catwhisker.org) Received: from albert.catwhisker.org (localhost [127.0.0.1]) by albert.catwhisker.org (8.15.2/8.15.2) with ESMTP id v1AEkEal078564; Fri, 10 Feb 2017 14:46:14 GMT (envelope-from david@albert.catwhisker.org) Received: (from david@localhost) by albert.catwhisker.org (8.15.2/8.15.2/Submit) id v1AEkDJa078563; Fri, 10 Feb 2017 06:46:13 -0800 (PST) (envelope-from david) Date: Fri, 10 Feb 2017 06:46:13 -0800 From: David Wolfskill To: Konstantin Belousov Cc: Iblis Lin , current@freebsd.org Subject: Re: dhclient fails: can't open and lock /var/db/dhclient.leases.wlan0: Bad file descriptor Message-ID: <20170210144613.GH1523@albert.catwhisker.org> Mail-Followup-To: David Wolfskill , Konstantin Belousov , Iblis Lin , current@freebsd.org References: <20170210132954.GE1523@albert.catwhisker.org> <20170210141041.GR2092@kib.kiev.ua> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="bM6T5tSEJf/15wE6" Content-Disposition: inline In-Reply-To: <20170210141041.GR2092@kib.kiev.ua> User-Agent: Mutt/1.7.2 (2016-11-26) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2017 14:46:17 -0000 --bM6T5tSEJf/15wE6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Feb 10, 2017 at 04:10:41PM +0200, Konstantin Belousov wrote: > ... > Please try this. >=20 > diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c > index 70cdcdc6f75..1f2cceaf7a6 100644 > --- a/sys/kern/vfs_vnops.c > +++ b/sys/kern/vfs_vnops.c > @@ -351,8 +351,8 @@ vn_open_vnode(struct vnode *vp, int fmode, struct ucr= ed *cred, > =20 > while ((fmode & (O_EXLOCK | O_SHLOCK)) !=3D 0) { > KASSERT(fp !=3D NULL, ("open with flock requires fp")); > - if (fp->f_type !=3D DTYPE_VNODE) { > - error =3D EBADF; > + if (fp->f_type !=3D DTYPE_NONE && fp->f_type !=3D DTYPE_VNODE) { > + error =3D EOPNOTSUPP; > break; > } > lock_flags =3D VOP_ISLOCKED(vp); > diff --git a/sys/sys/file.h b/sys/sys/file.h > index 353c92f365a..c51f26a41d2 100644 > --- a/sys/sys/file.h > +++ b/sys/sys/file.h > @@ -53,6 +53,7 @@ struct vnode; > =20 > #endif /* _KERNEL */ > =20 > +#define DTYPE_NONE 0 /* not yet initialized */ > #define DTYPE_VNODE 1 /* file */ > #define DTYPE_SOCKET 2 /* communications endpoint */ > #define DTYPE_PIPE 3 /* pipe */ That seems to have done it -- thank you! :-) Peace, david --=20 David H. Wolfskill david@catwhisker.org How could one possibly "respect" a misogynist, racist, bullying con-man??!? See http://www.catwhisker.org/~david/publickey.gpg for my public key. --bM6T5tSEJf/15wE6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQF8BAEBCgBmBQJYndI1XxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXRDQ0I3Q0VGOTE3QTgwMUY0MzA2NEQ3N0Ix NTM5Q0M0MEEwNDlFRTE3AAoJEBU5zECgSe4XUgYH/iOqXjn3WrkxgTh6kOwbzig4 phBZdj4US2yNBn4N86pBOWH9XByN5EhllosnKOLg/EHmHMDJDWLzpEjua2kbBLDJ BJG1Sz4rAVaLWpcE54q/oL0c4ZBufXsDgUF+DbRRGQOF4rfzUHhu8isYtePqqhae u1/7YlAGG8+o9dWExeCLtoFK2ADclxF+HQvSegSfwXj2xuv8qF70PYr49mDtCjak 6k4ttJSkQIsVVczDfFoYHAZVqsH3nxoOQHve8Vgc5QlIy65KQGvMQbIL7BaXSxFr RF8qI0IoGq08C0TpuMK6rcITKEWtE7tg8hqz4hm2xFqL7KCMYpIwyGXA4gJVZQU= =8zAk -----END PGP SIGNATURE----- --bM6T5tSEJf/15wE6--