Can you please start working as indentended? please....

This commit is contained in:
Denis 2023-12-14 14:05:13 +01:00
parent 49ba884623
commit 917ec565f8
No known key found for this signature in database
GPG key ID: DD9B63F805CF5C03
2 changed files with 4 additions and 4 deletions

View file

@ -532,7 +532,7 @@ void* dev_in_thread_func(void *ptr) {
if (dev_in_data->communication.type == ipc_client_socket) {
for (int msg_idx = 0; msg_idx < controller_msg_count; ++msg_idx) {
const int write_res = write(dev_in_data->communication.endpoint.socket.fd, (void*)&controller_msg[0], sizeof(in_message_t));
const int write_res = write(dev_in_data->communication.endpoint.socket.fd, (void*)&controller_msg[msg_idx], sizeof(in_message_t));
if (write_res < 0) {
fprintf(stderr, "Error in writing input event messages: %d -- connection will be drop and retried\n", write_res);
@ -543,7 +543,7 @@ void* dev_in_thread_func(void *ptr) {
}
} else if (dev_in_data->communication.type == ipc_unix_pipe) {
for (int msg_idx = 0; msg_idx < controller_msg_count; ++msg_idx) {
const int write_res = write(dev_in_data->communication.endpoint.pipe.in_message_pipe_fd, (void*)&controller_msg[0], sizeof(in_message_t));
const int write_res = write(dev_in_data->communication.endpoint.pipe.in_message_pipe_fd, (void*)&controller_msg[msg_idx], sizeof(in_message_t));
if (write_res < 0) {
fprintf(stderr, "Error in writing input event messages: %d\n", write_res);
}

View file

@ -326,7 +326,7 @@ void *dev_out_thread_func(void *ptr) {
// send out game-generated events to sockets
if (dev_out_data->communication.type == ipc_unix_pipe) {
for (int msg_idx = 0; msg_idx < out_msgs_count; ++msg_idx) {
const int write_res = write(dev_out_data->communication.endpoint.pipe.out_message_pipe_fd, (void*)&out_msgs, sizeof(out_message_t));
const int write_res = write(dev_out_data->communication.endpoint.pipe.out_message_pipe_fd, (void*)&out_msgs[msg_idx], sizeof(out_message_t));
if (write_res != sizeof(out_message_t)) {
fprintf(stderr, "Error in writing out_message to out_message_pipe: %d\n", write_res);
}
@ -336,7 +336,7 @@ void *dev_out_thread_func(void *ptr) {
for (int i = 0; i < MAX_CONNECTED_CLIENTS; ++i) {
if (dev_out_data->communication.endpoint.ssocket.clients[i] > 0) {
for (int msg_idx = 0; msg_idx < out_msgs_count; ++msg_idx) {
const int write_res = write(dev_out_data->communication.endpoint.ssocket.clients[i], (void*)&out_msgs, sizeof(out_message_t));
const int write_res = write(dev_out_data->communication.endpoint.ssocket.clients[i], (void*)&out_msgs[msg_idx], sizeof(out_message_t));
if (write_res != sizeof(out_message_t)) {
fprintf(stderr, "Error in writing out_message to socket number %d: %d\n", i, write_res);
close(dev_out_data->communication.endpoint.ssocket.clients[i]);