user_shell: Fix unchecked return value of osmo_fd_register()

Fixes: CID#307519: Unchecked return value (CHECKED_RETURN)
Change-Id: I68ed44464573b9a6fecd07cf13fd2d6f4a1013bb
This commit is contained in:
Harald Welte 2023-07-18 13:38:07 +02:00
parent 58eebe13c7
commit 958ae50de1
1 changed files with 5 additions and 1 deletions

View File

@ -170,11 +170,15 @@ static int stdin_fd_cb(struct osmo_fd *ofd, unsigned int what)
int client_user_main(struct bankd_client *bc)
{
struct stdin_state ss;
int rc;
/* register stdin file descriptor with osmocom select loop abstraction */
memset(&ss, 0, sizeof(ss));
osmo_fd_setup(&ss.ofd, fileno(stdin), OSMO_FD_READ, &stdin_fd_cb, &ss, 0);
osmo_fd_register(&ss.ofd);
rc = osmo_fd_register(&ss.ofd);
if (rc < 0)
return rc;
ss.bc = bc;
while (1) {