@@ -31,12 +31,14 @@ jbpf_lcm_ipc_send_req(jbpf_lcm_ipc_address_t* address, jbpf_lcm_ipc_req_msg_s* m
31
31
int res = JBPF_LCM_IPC_REQ_FAIL ;
32
32
33
33
if (!address || !msg ) {
34
+ jbpf_logger (JBPF_ERROR , "Invalid address or message\n" );
34
35
return JBPF_LCM_IPC_REQ_FAIL ;
35
36
}
36
37
37
38
sockfd = socket (AF_UNIX , SOCK_STREAM , 0 );
38
39
39
40
if (sockfd == -1 ) {
41
+ jbpf_logger (JBPF_ERROR , "Error creating socket: %s\n" , strerror (errno ));
40
42
goto out ;
41
43
}
42
44
@@ -50,10 +52,12 @@ jbpf_lcm_ipc_send_req(jbpf_lcm_ipc_address_t* address, jbpf_lcm_ipc_req_msg_s* m
50
52
}
51
53
52
54
if (send_all (sockfd , msg , sizeof (jbpf_lcm_ipc_req_msg_s ), 0 ) != sizeof (jbpf_lcm_ipc_req_msg_s )) {
55
+ jbpf_logger (JBPF_ERROR , "Error sending message to %s: %s\n" , server_addr .sun_path , strerror (errno ));
53
56
goto out ;
54
57
}
55
58
56
59
if (recv_all (sockfd , & resp , sizeof (jbpf_lcm_ipc_resp_msg_s ), MSG_WAITALL ) != sizeof (jbpf_lcm_ipc_resp_msg_s )) {
60
+ jbpf_logger (JBPF_ERROR , "Error receiving response from %s: %s\n" , server_addr .sun_path , strerror (errno ));
57
61
goto out ;
58
62
}
59
63
@@ -70,12 +74,14 @@ jbpf_lcm_ipc_server_init(jbpf_lcm_ipc_server_config_t* config)
70
74
struct jbpf_lcm_ipc_server_ctx * server ;
71
75
72
76
if (!config ) {
77
+ jbpf_logger (JBPF_ERROR , "Invalid server configuration\n" );
73
78
return NULL ;
74
79
}
75
80
76
81
server = calloc (1 , sizeof (struct jbpf_lcm_ipc_server_ctx ));
77
82
78
83
if (!server ) {
84
+ jbpf_logger (JBPF_ERROR , "Failed to allocate memory for server context\n" );
79
85
return NULL ;
80
86
}
81
87
@@ -216,6 +222,7 @@ jbpf_lcm_ipc_send_codeletset_load_req(jbpf_lcm_ipc_address_t* address, jbpf_code
216
222
jbpf_lcm_ipc_req_msg_s msg = {0 };
217
223
218
224
if (!address || !load_req ) {
225
+ jbpf_logger (JBPF_ERROR , "Invalid address or load request\n" );
219
226
return -1 ;
220
227
}
221
228
@@ -232,6 +239,7 @@ jbpf_lcm_ipc_send_codeletset_unload_req(jbpf_lcm_ipc_address_t* address, jbpf_co
232
239
jbpf_lcm_ipc_req_msg_s msg = {0 };
233
240
234
241
if (!address || !unload_req ) {
242
+ jbpf_logger (JBPF_ERROR , "Invalid address or unload request\n" );
235
243
return -1 ;
236
244
}
237
245
0 commit comments