server: Add a default access mapping function for files, and use it for devices too.
diff --git a/server/sock.c b/server/sock.c
index d7c1e68..0694c51 100644
--- a/server/sock.c
+++ b/server/sock.c
@@ -90,7 +90,6 @@
static void sock_dump( struct object *obj, int verbose );
static int sock_signaled( struct object *obj, struct thread *thread );
static struct fd *sock_get_fd( struct object *obj );
-static unsigned int sock_map_access( struct object *obj, unsigned int access );
static void sock_destroy( struct object *obj );
static int sock_get_poll_events( struct fd *fd );
@@ -113,7 +112,7 @@
no_satisfied, /* satisfied */
no_signal, /* signal */
sock_get_fd, /* get_fd */
- sock_map_access, /* map_access */
+ default_fd_map_access, /* map_access */
no_lookup_name, /* lookup_name */
no_open_file, /* open_file */
fd_close_handle, /* close_handle */
@@ -459,15 +458,6 @@
return check_fd_events( sock->fd, sock_get_poll_events( sock->fd ) ) != 0;
}
-static unsigned int sock_map_access( struct object *obj, unsigned int access )
-{
- if (access & GENERIC_READ) access |= FILE_GENERIC_READ;
- if (access & GENERIC_WRITE) access |= FILE_GENERIC_WRITE;
- if (access & GENERIC_EXECUTE) access |= FILE_GENERIC_EXECUTE;
- if (access & GENERIC_ALL) access |= FILE_ALL_ACCESS;
- return access & ~(GENERIC_READ | GENERIC_WRITE | GENERIC_EXECUTE | GENERIC_ALL);
-}
-
static int sock_get_poll_events( struct fd *fd )
{
struct sock *sock = get_fd_user( fd );