Skip to content

Commit

Permalink
shell: websocket: Fix build with websocket logger disabled
Browse files Browse the repository at this point in the history
In case websocket logger is disabled, the websocket shell backend should
still build, fix that.

Signed-off-by: Robert Lubos <[email protected]>
  • Loading branch information
rlubos authored and kartben committed Jan 13, 2025
1 parent 814aa38 commit 60f5337
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions subsys/shell/backends/shell_websocket.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ static void ws_end_client_connection(struct shell_websocket *ws)

LOG_DBG("Closing connection to #%d", ws->fds[0].fd);

(void)log_backend_ws_unregister(ws->fds[0].fd);
if (IS_ENABLED(CONFIG_LOG_BACKEND_WS)) {
(void)log_backend_ws_unregister(ws->fds[0].fd);
}

(void)websocket_unregister(ws->fds[0].fd);

Expand Down Expand Up @@ -212,8 +214,9 @@ static int shell_ws_init(struct shell_websocket *ctx, int ws_socket)
LOG_ERR("Failed to register socket service, %d", ret);
goto error;
}

log_backend_ws_register(ws_socket);
if (IS_ENABLED(CONFIG_LOG_BACKEND_WS)) {
log_backend_ws_register(ws_socket);
}

return 0;

Expand Down

0 comments on commit 60f5337

Please sign in to comment.