James Carlson wrote:
> Alan Coopersmith wrote:
>> X won't get ENODEV until select() returns that there's something to read
>> on the device and we attempt to read() from it.   If neither the kernel
>> nor HAL somehow signal X, we'll never notice.
> 
> If you're selecting on the device, and the device itself is removed,
> will you wake up with that fd in the errorfds list?  If not, I think
> that's a kernel bug, and you certainly should.  If you do wake up but
> don't recognize that errorfds is as interesting as read()==-1, then that
> sounds like an application problem.

Well, erm, X has never actually passed a non-NULL pointer for errorfd's
in the Xserver select() loop, it only selects for read & write:
   http://cgit.freedesktop.org/xorg/xserver/tree/os/WaitFor.c

I don't know why, that code is far older than my involvement with X...
It expects select() to return EBADF when a client disconnects, and
device disconnection used to be impossible, then became something
HAL was expected to notify us of, so it may just never have been an
issue.

-- 
        -Alan Coopersmith-        alan.coopersmith at oracle.com
         Oracle Solaris Platform Engineering: X Window System

Reply via email to