server: Don't bother with default entry points for objects that don't even return an fd.

This commit is contained in:
Alexandre Julliard 2007-04-12 20:21:53 +02:00
parent 72ff2bf363
commit 3f0575943e
8 changed files with 25 additions and 46 deletions

View File

@ -518,11 +518,11 @@ static const struct fd_ops inotify_fd_ops =
{
inotify_get_poll_events, /* get_poll_events */
inotify_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
default_fd_queue_async, /* queue_async */
default_fd_reselect_async, /* reselect_async */
default_fd_cancel_async, /* cancel_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
NULL, /* cancel_async */
};
static int inotify_get_poll_events( struct fd *fd )

View File

@ -1779,24 +1779,6 @@ void no_flush( struct fd *fd, struct event **event )
set_error( STATUS_OBJECT_TYPE_MISMATCH );
}
/* default get_fd_type() routine */
enum server_fd_type no_get_fd_type( struct fd *fd )
{
return FD_TYPE_INVALID;
}
/* default queue_async() routine */
void no_queue_async( struct fd *fd, const async_data_t *data, int type, int count)
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
}
/* default cancel_async() routine */
void no_cancel_async( struct fd *fd )
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
}
static inline int is_valid_mounted_device( struct stat *st )
{
#if defined(linux) || defined(__sun__)

View File

@ -78,9 +78,6 @@ extern void default_fd_queue_async( struct fd *fd, const async_data_t *data, int
extern void default_fd_reselect_async( struct fd *fd, struct async_queue *queue );
extern void default_fd_cancel_async( struct fd *fd );
extern void no_flush( struct fd *fd, struct event **event );
extern enum server_fd_type no_get_fd_type( struct fd *fd );
extern void no_queue_async( struct fd *fd, const async_data_t *data, int type, int count);
extern void no_cancel_async( struct fd *fd );
extern void main_loop(void);
extern void remove_process_locks( struct process *process );

View File

@ -84,11 +84,11 @@ static const struct fd_ops process_fd_ops =
{
NULL, /* get_poll_events */
process_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
no_queue_async, /* queue_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
no_cancel_async /* cancel async */
NULL /* cancel async */
};
/* process startup info */

View File

@ -166,11 +166,11 @@ static const struct fd_ops msg_queue_fd_ops =
{
NULL, /* get_poll_events */
msg_queue_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
no_queue_async, /* queue_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
no_cancel_async /* cancel async */
NULL /* cancel async */
};

View File

@ -106,11 +106,11 @@ static const struct fd_ops master_socket_fd_ops =
{
NULL, /* get_poll_events */
master_socket_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
no_queue_async, /* queue_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
no_cancel_async /* cancel_async */
NULL /* cancel_async */
};

View File

@ -82,11 +82,11 @@ static const struct fd_ops handler_fd_ops =
{
NULL, /* get_poll_events */
handler_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
no_queue_async, /* queue_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
no_cancel_async /* cancel_async */
NULL /* cancel_async */
};
static struct handler *handler_sighup;

View File

@ -129,11 +129,11 @@ static const struct fd_ops thread_fd_ops =
{
NULL, /* get_poll_events */
thread_poll_event, /* poll_event */
no_flush, /* flush */
no_get_fd_type, /* get_fd_type */
no_queue_async, /* queue_async */
NULL, /* flush */
NULL, /* get_fd_type */
NULL, /* queue_async */
NULL, /* reselect_async */
no_cancel_async /* cancel_async */
NULL /* cancel_async */
};
static struct list thread_list = LIST_INIT(thread_list);