Commit 70d12630 authored by Zebediah Figura's avatar Zebediah Figura Committed by Alexandre Julliard

server: Use default_fd_get_poll_events() for file objects.

This avoids sending the server into a busy-loop when trying to perform an asynchronous read from a non-regular file (say, a FIFO). Signed-off-by: 's avatarZebediah Figura <z.figura12@gmail.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent fe11ff87
......@@ -75,7 +75,6 @@ static struct object *file_open_file( struct object *obj, unsigned int access,
static struct list *file_get_kernel_obj_list( struct object *obj );
static void file_destroy( struct object *obj );
static int file_get_poll_events( struct fd *fd );
static enum server_fd_type file_get_fd_type( struct fd *fd );
static const struct object_ops file_ops =
......@@ -104,7 +103,7 @@ static const struct object_ops file_ops =
static const struct fd_ops file_fd_ops =
{
file_get_poll_events, /* get_poll_events */
default_fd_get_poll_events, /* get_poll_events */
default_poll_event, /* poll_event */
file_get_fd_type, /* get_fd_type */
no_fd_read, /* read */
......@@ -287,16 +286,6 @@ struct object_type *file_get_type( struct object *obj )
return get_object_type( &str );
}
static int file_get_poll_events( struct fd *fd )
{
struct file *file = get_fd_user( fd );
int events = 0;
assert( file->obj.ops == &file_ops );
if (file->access & FILE_UNIX_READ_ACCESS) events |= POLLIN;
if (file->access & FILE_UNIX_WRITE_ACCESS) events |= POLLOUT;
return events;
}
static enum server_fd_type file_get_fd_type( struct fd *fd )
{
struct file *file = get_fd_user( fd );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment