From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Vojtech Pavlik <vojtech@suse.de>
Cc: David Fries <dfries@mail.win.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Linux joydev joystick disconnect patch 2.6.11-rc2
Date: Sun, 6 Feb 2005 20:21:13 -0500 [thread overview]
Message-ID: <200502062021.13726.dtor_core@ameritech.net> (raw)
In-Reply-To: <20050206131241.GA19564@ucw.cz>
On Sunday 06 February 2005 08:12, Vojtech Pavlik wrote:
> On Tue, Feb 01, 2005 at 10:24:39AM -0500, Dmitry Torokhov wrote:
> > On Tue, 1 Feb 2005 08:52:15 -0600, David Fries <dfries@mail.win.org> wrote:
> > > Currently a blocking read, select, or poll call will not return if a
> > > joystick device is unplugged. This patch allows them to return.
> > >
> > ...
> > > static unsigned int joydev_poll(struct file *file, poll_table *wait)
> > > {
> > > + int mask = 0;
> > > struct joydev_list *list = file->private_data;
> > > poll_wait(file, &list->joydev->wait, wait);
> > > - if (list->head != list->tail || list->startup < list->joydev->nabs + list->joydev->nkey)
> > > - return POLLIN | POLLRDNORM;
> > > - return 0;
> > > + if(!list->joydev->exist)
> > > + mask |= POLLERR;
> >
> > Probably need POLLHUP in addition (or instead of POLLERR).
> >
> > > if (joydev->open)
> > > + {
> > > input_close_device(handle);
> > > + wake_up_interruptible(&joydev->wait);
> > > + }
> > > else
> > > + {
> > > joydev_free(joydev);
> > > + }
> >
> > Opening braces should go on the same line as the statement (if (...) {).
>
> How about this patch?
Looks fine now. Hmm, wait a sec... Don't we also need kill_fasync calls in
disconnect routines as well?
--
Dmitry
next prev parent reply other threads:[~2005-02-07 1:21 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20041123212813.GA3196@spacedout.fries.net>
2005-02-01 14:52 ` [PATCH] Linux joydev joystick disconnect patch 2.6.11-rc2 David Fries
2005-02-01 15:24 ` Dmitry Torokhov
2005-02-06 13:12 ` Vojtech Pavlik
2005-02-07 1:21 ` Dmitry Torokhov [this message]
2005-02-07 6:59 ` Vojtech Pavlik
2005-02-07 12:20 ` Vojtech Pavlik
2005-02-07 14:22 ` Dmitry Torokhov
2005-02-07 18:51 ` Vojtech Pavlik
2005-02-08 15:29 ` David Fries
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200502062021.13726.dtor_core@ameritech.net \
--to=dtor_core@ameritech.net \
--cc=dfries@mail.win.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vojtech@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox