Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
388e6f0d
Commit
388e6f0d
authored
Feb 06, 2005
by
Vojtech Pavlik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
input: Fix poll() behavior of input handlers on disconnect.
Signed-off-by:
Vojtech Pavlik
<
vojtech@suse.cz
>
parent
113fc8b3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
15 deletions
+12
-15
drivers/input/evdev.c
drivers/input/evdev.c
+2
-3
drivers/input/joydev.c
drivers/input/joydev.c
+5
-5
drivers/input/mousedev.c
drivers/input/mousedev.c
+3
-3
drivers/input/tsdev.c
drivers/input/tsdev.c
+2
-4
No files found.
drivers/input/evdev.c
View file @
388e6f0d
...
...
@@ -199,9 +199,8 @@ static unsigned int evdev_poll(struct file *file, poll_table *wait)
{
struct
evdev_list
*
list
=
file
->
private_data
;
poll_wait
(
file
,
&
list
->
evdev
->
wait
,
wait
);
if
(
list
->
head
!=
list
->
tail
)
return
POLLIN
|
POLLRDNORM
;
return
0
;
return
((
list
->
head
==
list
->
tail
)
?
0
:
(
POLLIN
|
POLLRDNORM
))
|
(
list
->
evdev
->
exist
?
0
:
(
POLLHUP
|
POLLERR
));
}
static
int
evdev_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
...
...
drivers/input/joydev.c
View file @
388e6f0d
...
...
@@ -281,9 +281,8 @@ static unsigned int joydev_poll(struct file *file, poll_table *wait)
{
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
;
return
((
list
->
head
!=
list
->
tail
||
list
->
startup
<
list
->
joydev
->
nabs
+
list
->
joydev
->
nkey
)
?
(
POLLIN
|
POLLRDNORM
)
:
0
)
|
(
list
->
joydev
->
exist
?
0
:
(
POLLHUP
|
POLLERR
));
}
static
int
joydev_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
unsigned
int
cmd
,
unsigned
long
arg
)
...
...
@@ -468,9 +467,10 @@ static void joydev_disconnect(struct input_handle *handle)
devfs_remove
(
"input/js%d"
,
joydev
->
minor
);
joydev
->
exist
=
0
;
if
(
joydev
->
open
)
if
(
joydev
->
open
)
{
input_close_device
(
handle
);
else
wake_up_interruptible
(
&
joydev
->
wait
);
}
else
joydev_free
(
joydev
);
}
...
...
drivers/input/mousedev.c
View file @
388e6f0d
...
...
@@ -595,9 +595,8 @@ static unsigned int mousedev_poll(struct file *file, poll_table *wait)
{
struct
mousedev_list
*
list
=
file
->
private_data
;
poll_wait
(
file
,
&
list
->
mousedev
->
wait
,
wait
);
if
(
list
->
ready
||
list
->
buffer
)
return
POLLIN
|
POLLRDNORM
;
return
0
;
return
((
list
->
ready
||
list
->
buffer
)
?
(
POLLIN
|
POLLRDNORM
)
:
0
)
|
(
list
->
mousedev
->
exist
?
0
:
(
POLLHUP
|
POLLERR
));
}
static
struct
file_operations
mousedev_fops
=
{
...
...
@@ -660,6 +659,7 @@ static void mousedev_disconnect(struct input_handle *handle)
if
(
mousedev
->
open
)
{
input_close_device
(
handle
);
wake_up_interruptible
(
&
mousedev
->
wait
);
}
else
{
if
(
mousedev_mix
.
open
)
input_close_device
(
handle
);
...
...
drivers/input/tsdev.c
View file @
388e6f0d
...
...
@@ -232,11 +232,9 @@ static ssize_t tsdev_read(struct file *file, char __user *buffer, size_t count,
static
unsigned
int
tsdev_poll
(
struct
file
*
file
,
poll_table
*
wait
)
{
struct
tsdev_list
*
list
=
file
->
private_data
;
poll_wait
(
file
,
&
list
->
tsdev
->
wait
,
wait
);
if
(
list
->
head
!=
list
->
tail
)
return
POLLIN
|
POLLRDNORM
;
return
0
;
return
((
list
->
head
==
list
->
tail
)
?
0
:
(
POLLIN
|
POLLRDNORM
))
|
(
list
->
tsdev
->
exist
?
0
:
(
POLLHUP
|
POLLERR
));
}
static
int
tsdev_ioctl
(
struct
inode
*
inode
,
struct
file
*
file
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment