Skip to content

Commit bc2858a

Browse files
rluboshenrikbrixandersen
authored andcommitted
net: lib: coap: Add error check when waking server thread
There's not much to be done in case waking up the server thread with socketpair send() fails, but at least we can log an error on such event (to please coverity). Signed-off-by: Robert Lubos <[email protected]>
1 parent b2b4016 commit bc2858a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

subsys/net/lib/coap/coap_server.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,9 @@ static int coap_server_poll_timeout(void)
335335

336336
static void coap_server_update_services(void)
337337
{
338-
zsock_send(control_socks[1], &(char){0}, 1, 0);
338+
if (zsock_send(control_socks[1], &(char){0}, 1, 0) < 0) {
339+
LOG_ERR("Failed to notify server thread (%d)", errno);
340+
}
339341
}
340342

341343
static inline bool coap_service_in_section(const struct coap_service *service)

0 commit comments

Comments
 (0)