On Sat, Jul 12, 2014 at 03:35:04PM +0000, Mateusz Guzik wrote:
> Author: mjg
> Date: Sat Jul 12 15:35:04 2014
> New Revision: 268570
> URL: http://svnweb.freebsd.org/changeset/base/268570
> 
> Log:
>   Clear nonblock and async on devctl close instaed of open.
>   
>   This is a purely cosmetic change.
> 
> Modified:
>   head/sys/kern/subr_bus.c
> 
> Modified: head/sys/kern/subr_bus.c
> ==============================================================================
> --- head/sys/kern/subr_bus.c  Sat Jul 12 15:19:30 2014        (r268569)
> +++ head/sys/kern/subr_bus.c  Sat Jul 12 15:35:04 2014        (r268570)
> @@ -438,8 +438,6 @@ devopen(struct cdev *dev, int oflags, in
>       }
>       /* move to init */
>       devsoftc.inuse = 1;
> -     devsoftc.nonblock = 0;
> -     devsoftc.async = 0;
>       mtx_unlock(&devsoftc.mtx);
>       return (0);
>  }
> @@ -450,6 +448,8 @@ devclose(struct cdev *dev, int fflag, in
>  
>       mtx_lock(&devsoftc.mtx);
>       devsoftc.inuse = 0;
> +     devsoftc.nonblock = 0;
> +     devsoftc.async = 0;
>       cv_broadcast(&devsoftc.cv);
>       funsetown(&devsoftc.sigio);
>       mtx_unlock(&devsoftc.mtx);
This is not pure cosmetic.  devctl does not track closes, so opens are
not matched with close calls.  Now any close clears nonblock and async,
which is not how it was done before.  Tracking close calls does not
work reliably.

FWIW, I think that both old and new behaviour are bugs, and I am not
sure why changing one for another (instead of fix).

Attachment: pgpEWkuvq8wi3.pgp
Description: PGP signature

Reply via email to