server: Store valid file options in pseudo file descriptors.
This commit is contained in:
parent
451616ee45
commit
017480d4e2
|
@ -1409,7 +1409,7 @@ static struct fd *alloc_fd_object(void)
|
|||
}
|
||||
|
||||
/* allocate a pseudo fd object, for objects that need to behave like files but don't have a unix fd */
|
||||
struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user )
|
||||
struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user, unsigned int options )
|
||||
{
|
||||
struct fd *fd = alloc_object( &fd_ops );
|
||||
|
||||
|
@ -1420,6 +1420,7 @@ struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *use
|
|||
fd->inode = NULL;
|
||||
fd->closed = NULL;
|
||||
fd->access = 0;
|
||||
fd->options = options;
|
||||
fd->sharing = 0;
|
||||
fd->unix_fd = -1;
|
||||
fd->signaled = 0;
|
||||
|
|
|
@ -52,7 +52,8 @@ struct fd_ops
|
|||
|
||||
/* file descriptor functions */
|
||||
|
||||
extern struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user );
|
||||
extern struct fd *alloc_pseudo_fd( const struct fd_ops *fd_user_ops, struct object *user,
|
||||
unsigned int options );
|
||||
extern void set_no_fd_status( struct fd *fd, unsigned int status );
|
||||
extern struct fd *open_fd( const char *name, int flags, mode_t *mode, unsigned int access,
|
||||
unsigned int sharing, unsigned int options );
|
||||
|
|
|
@ -359,7 +359,7 @@ void create_mailslot_device( struct directory *root, const struct unicode_str *n
|
|||
get_error() != STATUS_OBJECT_NAME_EXISTS)
|
||||
{
|
||||
dev->mailslots = NULL;
|
||||
if (!(dev->fd = alloc_pseudo_fd( &mailslot_device_fd_ops, &dev->obj )) ||
|
||||
if (!(dev->fd = alloc_pseudo_fd( &mailslot_device_fd_ops, &dev->obj, 0 )) ||
|
||||
!(dev->mailslots = create_namespace( 7 )))
|
||||
{
|
||||
release_object( dev );
|
||||
|
|
|
@ -480,7 +480,7 @@ void create_named_pipe_device( struct directory *root, const struct unicode_str
|
|||
get_error() != STATUS_OBJECT_NAME_EXISTS)
|
||||
{
|
||||
dev->pipes = NULL;
|
||||
if (!(dev->fd = alloc_pseudo_fd( &named_pipe_device_fd_ops, &dev->obj )) ||
|
||||
if (!(dev->fd = alloc_pseudo_fd( &named_pipe_device_fd_ops, &dev->obj, 0 )) ||
|
||||
!(dev->pipes = create_namespace( 7 )))
|
||||
{
|
||||
release_object( dev );
|
||||
|
@ -709,7 +709,7 @@ static struct pipe_server *create_pipe_server( struct named_pipe *pipe, unsigned
|
|||
|
||||
list_add_head( &pipe->servers, &server->entry );
|
||||
grab_object( pipe );
|
||||
if (!(server->ioctl_fd = alloc_pseudo_fd( &pipe_server_fd_ops, &server->obj )))
|
||||
if (!(server->ioctl_fd = alloc_pseudo_fd( &pipe_server_fd_ops, &server->obj, options )))
|
||||
{
|
||||
release_object( server );
|
||||
server = NULL;
|
||||
|
|
Loading…
Reference in New Issue