This lists all fields of the `struct fd_ops` when object of that type -- `handler_fd_ops` in server/signal.c -- is being initialized.
It looks like field list in initialization of the `handler_fd_ops` in server/signal.c was out-of-sync for a long time. Take a look, for example, on patches ad1e0609a0f (server: Get rid of no loner used cancel_async from fd_ops., 2016-12-01) (which removed "reference" to the `cancel_async` field correctly, but did not add "references" to the `read` and `write` fields, for example), or 837b39b2028 (server: Add read and write fd member functions., 2015-05-05) (which updated `struct fd_ops` but did not change initialization of the `handler_fd_ops` at all).
Because the main purpose of initialization of the `handler_fd_ops` made in server/signal.c is to assign address of the `handler_poll_event()` function to the `poll_event` field, while making all other fields `NULL`ed, lacking some fields in that initialization is not an error according to C standard:
6.7.11 Initialization
11 ... If an object that has static or thread storage duration is not initialized explicitly, or any object is initialized with an empty initializer, then it is subject to default initialization, which initializes an object as follows:
- if it has pointer type, it is initialized to a null pointer;
...
22 If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate is subject to default initialization.
But to maintain code consistency I believe initialization of the `handler_fd_ops` object should enumerate all fields of the `struct fd_ops` type.
No functional changes intended.
```shell $ ./configure ... $ make ... $ ./wine --version wine-9.6-74-g6a1dab2af04 ```
-- v27: Fix initialization of the msg_queue_fd_ops Fix initialization of the process_fd_ops Fix initialization of the thread_fd_ops Fix initialization of the inotify_fd_ops Fix initialization of the master_socket_fd_ops Fix initialization of the handler_fd_ops
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- handler_fd_ops in server/signal.c -- is being initialized.
It looks like field list in initialization of the handler_fd_ops in server/signal.c was out-of-sync for a long time. Take a look, for example, on patches ad1e0609a0f (server: Get rid of no loner used cancel_async from fd_ops., 2016-12-01) (which removed "reference" to the cancel_async field correctly, but did not add "references" to the read and write fields, for example), or 837b39b2028 (server: Add read and write fd member functions., 2015-05-05) (which updated `struct fd_ops' but did not change initialization of the handler_fd_ops at all).
Because the main purpose of initialization of the handler_fd_ops made in server/signal.c is to assign address of the handler_poll_event() function to the poll_event field, while making all other fields NULLed, lacking some fields in that initialization is not an error according to C standard:
6.7.11 Initialization
11 ... If an object that has static or thread storage duration is not initialized explicitly, or any object is initialized with an empty initializer, then it is subject to default initialization, which initializes an object as follows:
- if it has pointer type, it is initialized to a null pointer;
... 22 If there are fewer initializers in a brace-enclosed list than there are elements or members of an aggregate, or fewer characters in a string literal used to initialize an array of known size than there are elements in the array, the remainder of the aggregate is subject to default initialization.
But to maintain code consistency I believe initialization of the handler_fd_ops object should enumerate all fields of the `struct fd_ops' type.
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/signal.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/signal.c b/server/signal.c index 19b76d44c16..45a516f4599 100644 --- a/server/signal.c +++ b/server/signal.c @@ -84,9 +84,14 @@ static const struct fd_ops handler_fd_ops = { NULL, /* get_poll_events */ handler_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ NULL /* reselect_async */ };
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- master_socket_fd_ops in server/request.c -- is being initialized.
For motivation behind this patch please read message of the previous commit 0bd610a1680 (Fix initialization of the handler_fd_ops, 2024-04-16).
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/request.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/request.c b/server/request.c index 2691e0c7cff..bb9b978df46 100644 --- a/server/request.c +++ b/server/request.c @@ -110,9 +110,14 @@ static const struct fd_ops master_socket_fd_ops = { NULL, /* get_poll_events */ master_socket_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ NULL /* reselect_async */ };
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- inotify_fd_ops in server/change.c -- is being initialized.
For motivation behind this patch please read message of commit 0bd610a1680 (Fix initialization of the handler_fd_ops, 2024-04-16).
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/change.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/change.c b/server/change.c index f773ccf8831..36c648f18b7 100644 --- a/server/change.c +++ b/server/change.c @@ -644,9 +644,14 @@ static const struct fd_ops inotify_fd_ops = { inotify_get_poll_events, /* get_poll_events */ inotify_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ NULL /* reselect_async */ };
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- thread_fd_ops in server/thread.c -- is being initialized.
For motivation behind this patch please read message of commit 0bd610a1680 (Fix initialization of the handler_fd_ops, 2024-04-16).
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/thread.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/server/thread.c b/server/thread.c index 6542e1584ab..dd4b029c8ca 100644 --- a/server/thread.c +++ b/server/thread.c @@ -207,9 +207,14 @@ static const struct fd_ops thread_fd_ops = { NULL, /* get_poll_events */ thread_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ NULL /* reselect_async */ };
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- process_fd_ops in server/process.c -- is being initialized.
For motivation behind this patch please read message of commit 0bd610a1680 (Fix initialization of the handler_fd_ops, 2024-04-16).
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/process.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/server/process.c b/server/process.c index 155dc050d95..dc4172fb16d 100644 --- a/server/process.c +++ b/server/process.c @@ -125,12 +125,16 @@ static const struct fd_ops process_fd_ops = { NULL, /* get_poll_events */ process_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ - NULL, /* reselect_async */ - NULL /* cancel async */ + NULL /* reselect_async */ };
/* process startup info */
From: Ruslan Garipov ruslanngaripov@gmail.com
This lists all fields of the `struct fd_ops' when object of that type -- msg_queue_fd_ops in server/queue.c -- is being initialized.
For motivation behind this patch please read message of commit 0bd610a1680 (Fix initialization of the handler_fd_ops, 2024-04-16).
No functional changes intended.
Signed-off-by: Ruslan Garipov ruslanngaripov@gmail.com --- server/queue.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/server/queue.c b/server/queue.c index 0156a4c66f2..1dfa6568aa6 100644 --- a/server/queue.c +++ b/server/queue.c @@ -184,12 +184,16 @@ static const struct fd_ops msg_queue_fd_ops = { NULL, /* get_poll_events */ msg_queue_poll_event, /* poll_event */ - NULL, /* flush */ NULL, /* get_fd_type */ + NULL, /* read */ + NULL, /* write */ + NULL, /* flush */ + NULL, /* get_file_info */ + NULL, /* get_volume_info */ NULL, /* ioctl */ + NULL, /* cancel_async */ NULL, /* queue_async */ - NULL, /* reselect_async */ - NULL /* cancel async */ + NULL /* reselect_async */ };