# HG changeset patch # User Edouard Tisserant # Date 1700648656 -3600 # Node ID 098875cff39fbfff83216d587e50c9e9a2b26ff8 # Parent dcc83e03d065485dba5f10e2fdfe7f656b55cca3 Modbus: More verbose error message in case of thread creation problem diff -r dcc83e03d065 -r 098875cff39f modbus/mb_runtime.c --- a/modbus/mb_runtime.c Wed Nov 22 09:34:32 2023 +0100 +++ b/modbus/mb_runtime.c Wed Nov 22 11:24:16 2023 +0100 @@ -690,7 +690,7 @@ res |= pthread_attr_init(&attr); res |= pthread_create(&(client_nodes[index].timer_thread_id), &attr, &__mb_client_timer_thread, (void *)((char *)NULL + index)); if (res != 0) { - fprintf(stderr, "Modbus plugin: Error starting timer thread for modbus client node %%s\n", client_nodes[index].location); + fprintf(stderr, "Modbus plugin: Error (%%d) starting timer thread for modbus client node %%s\n", res, client_nodes[index].location); goto error_exit; } } @@ -703,7 +703,7 @@ res |= pthread_attr_init(&attr); res |= pthread_create(&(client_nodes[index].thread_id), &attr, &__mb_client_thread, (void *)((char *)NULL + index)); if (res != 0) { - fprintf(stderr, "Modbus plugin: Error starting thread for modbus client node %%s\n", client_nodes[index].location); + fprintf(stderr, "Modbus plugin: Error (%%d) starting thread for modbus client node %%s\n", res, client_nodes[index].location); goto error_exit; } } @@ -730,7 +730,7 @@ res |= pthread_attr_init(&attr); res |= pthread_create(&(server_nodes[index].thread_id), &attr, &__mb_server_thread, (void *)&(server_nodes[index])); if (res != 0) { - fprintf(stderr, "Modbus plugin: Error starting modbus server thread for node %%s\n", server_nodes[index].location); + fprintf(stderr, "Modbus plugin: Error (%%d) starting modbus server thread for node %%s\n", res, server_nodes[index].location); goto error_exit; } }