Zebediah Figura : server: Return void from the read callback.
Alexandre Julliard
julliard at winehq.org
Fri Sep 3 16:25:29 CDT 2021
Module: wine
Branch: master
Commit: 6d499911880df47f6b604dc2df3a24cc63ed667a
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6d499911880df47f6b604dc2df3a24cc63ed667a
Author: Zebediah Figura <zfigura at codeweavers.com>
Date: Thu Sep 2 19:08:51 2021 -0500
server: Return void from the read callback.
Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
server/console.c | 16 ++++++++--------
server/device.c | 6 +++---
server/fd.c | 3 +--
server/file.h | 4 ++--
server/named_pipe.c | 13 ++++++-------
5 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/server/console.c b/server/console.c
index 9c7fbaa003d..597bff994a2 100644
--- a/server/console.c
+++ b/server/console.c
@@ -100,7 +100,7 @@ static const struct object_ops console_ops =
static enum server_fd_type console_get_fd_type( struct fd *fd );
static void console_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
static void console_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
-static int console_read( struct fd *fd, struct async *async, file_pos_t pos );
+static void console_read( struct fd *fd, struct async *async, file_pos_t pos );
static int console_flush( struct fd *fd, struct async *async );
static int console_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
@@ -325,7 +325,7 @@ static const struct object_ops console_input_ops =
console_input_destroy /* destroy */
};
-static int console_input_read( struct fd *fd, struct async *async, file_pos_t pos );
+static void console_input_read( struct fd *fd, struct async *async, file_pos_t pos );
static int console_input_flush( struct fd *fd, struct async *async );
static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
@@ -948,16 +948,16 @@ static int console_ioctl( struct fd *fd, ioctl_code_t code, struct async *async
}
}
-static int console_read( struct fd *fd, struct async *async, file_pos_t pos )
+static void console_read( struct fd *fd, struct async *async, file_pos_t pos )
{
struct console *console = get_fd_user( fd );
if (!console->server)
{
set_error( STATUS_INVALID_HANDLE );
- return 0;
+ return;
}
- return queue_host_ioctl( console->server, IOCTL_CONDRV_READ_FILE, 0, async, &console->ioctl_q );
+ queue_host_ioctl( console->server, IOCTL_CONDRV_READ_FILE, 0, async, &console->ioctl_q );
}
static int console_flush( struct fd *fd, struct async *async )
@@ -1349,16 +1349,16 @@ static int console_input_ioctl( struct fd *fd, ioctl_code_t code, struct async *
return console_ioctl( console->fd, code, async );
}
-static int console_input_read( struct fd *fd, struct async *async, file_pos_t pos )
+static void console_input_read( struct fd *fd, struct async *async, file_pos_t pos )
{
struct console *console = current->process->console;
if (!console)
{
set_error( STATUS_INVALID_HANDLE );
- return 0;
+ return;
}
- return console_read( console->fd, async, pos );
+ console_read( console->fd, async, pos );
}
static int console_input_flush( struct fd *fd, struct async *async )
diff --git a/server/device.c b/server/device.c
index e4a5c2f9670..4dd9213811a 100644
--- a/server/device.c
+++ b/server/device.c
@@ -201,7 +201,7 @@ static struct list *device_file_get_kernel_obj_list( struct object *obj );
static int device_file_close_handle( struct object *obj, struct process *process, obj_handle_t handle );
static void device_file_destroy( struct object *obj );
static enum server_fd_type device_file_get_fd_type( struct fd *fd );
-static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos );
+static void device_file_read( struct fd *fd, struct async *async, file_pos_t pos );
static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos );
static int device_file_flush( struct fd *fd, struct async *async );
static int device_file_ioctl( struct fd *fd, ioctl_code_t code, struct async *async );
@@ -625,7 +625,7 @@ static void device_file_get_volume_info( struct fd *fd, struct async *async, uns
queue_irp( file, ¶ms, async );
}
-static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos )
+static void device_file_read( struct fd *fd, struct async *async, file_pos_t pos )
{
struct device_file *file = get_fd_user( fd );
irp_params_t params;
@@ -634,7 +634,7 @@ static int device_file_read( struct fd *fd, struct async *async, file_pos_t pos
params.read.type = IRP_CALL_READ;
params.read.key = 0;
params.read.pos = pos;
- return queue_irp( file, ¶ms, async );
+ queue_irp( file, ¶ms, async );
}
static int device_file_write( struct fd *fd, struct async *async, file_pos_t pos )
diff --git a/server/fd.c b/server/fd.c
index 93359ea03a5..c2cab0da1fe 100644
--- a/server/fd.c
+++ b/server/fd.c
@@ -2292,10 +2292,9 @@ static void unmount_device( struct fd *device_fd )
}
/* default read() routine */
-int no_fd_read( struct fd *fd, struct async *async, file_pos_t pos )
+void no_fd_read( struct fd *fd, struct async *async, file_pos_t pos )
{
set_error( STATUS_OBJECT_TYPE_MISMATCH );
- return 0;
}
/* default write() routine */
diff --git a/server/file.h b/server/file.h
index 6b949537084..e4b8422660a 100644
--- a/server/file.h
+++ b/server/file.h
@@ -57,7 +57,7 @@ struct fd_ops
/* get file information */
enum server_fd_type (*get_fd_type)(struct fd *fd);
/* perform a read on the file */
- int (*read)(struct fd *, struct async *, file_pos_t );
+ void (*read)(struct fd *, struct async *, file_pos_t );
/* perform a write on the file */
int (*write)(struct fd *, struct async *, file_pos_t );
/* flush the object buffers */
@@ -109,7 +109,7 @@ extern void default_poll_event( struct fd *fd, int event );
extern void fd_queue_async( struct fd *fd, struct async *async, int type );
extern void fd_async_wake_up( struct fd *fd, int type, unsigned int status );
extern void fd_reselect_async( struct fd *fd, struct async_queue *queue );
-extern int no_fd_read( struct fd *fd, struct async *async, file_pos_t pos );
+extern void no_fd_read( struct fd *fd, struct async *async, file_pos_t pos );
extern int no_fd_write( struct fd *fd, struct async *async, file_pos_t pos );
extern int no_fd_flush( struct fd *fd, struct async *async );
extern void no_fd_get_file_info( struct fd *fd, obj_handle_t handle, unsigned int info_class );
diff --git a/server/named_pipe.c b/server/named_pipe.c
index 72a61253a54..b81e167ddfc 100644
--- a/server/named_pipe.c
+++ b/server/named_pipe.c
@@ -143,7 +143,7 @@ static struct security_descriptor *pipe_end_get_sd( struct object *obj );
static int pipe_end_set_sd( struct object *obj, const struct security_descriptor *sd,
unsigned int set_info );
static WCHAR *pipe_end_get_full_name( struct object *obj, data_size_t *len );
-static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos );
+static void pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos );
static int pipe_end_write( struct fd *fd, struct async *async_data, file_pos_t pos );
static int pipe_end_flush( struct fd *fd, struct async *async );
static void pipe_end_get_volume_info( struct fd *fd, struct async *async, unsigned int info_class );
@@ -893,7 +893,7 @@ static void reselect_write_queue( struct pipe_end *pipe_end )
reselect_read_queue( reader, 0 );
}
-static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
+static void pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
{
struct pipe_end *pipe_end = get_fd_user( fd );
@@ -903,25 +903,24 @@ static int pipe_end_read( struct fd *fd, struct async *async, file_pos_t pos )
if ((pipe_end->flags & NAMED_PIPE_NONBLOCKING_MODE) && list_empty( &pipe_end->message_queue ))
{
set_error( STATUS_PIPE_EMPTY );
- return 0;
+ return;
}
break;
case FILE_PIPE_DISCONNECTED_STATE:
set_error( STATUS_PIPE_DISCONNECTED );
- return 0;
+ return;
case FILE_PIPE_LISTENING_STATE:
set_error( STATUS_PIPE_LISTENING );
- return 0;
+ return;
case FILE_PIPE_CLOSING_STATE:
if (!list_empty( &pipe_end->message_queue )) break;
set_error( STATUS_PIPE_BROKEN );
- return 0;
+ return;
}
queue_async( &pipe_end->read_q, async );
reselect_read_queue( pipe_end, 0 );
set_error( STATUS_PENDING );
- return 1;
}
static int pipe_end_write( struct fd *fd, struct async *async, file_pos_t pos )
More information about the wine-cvs
mailing list