laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-remsim/+/33779 )
Change subject: user_shell: Fix unchecked return value of osmo_fd_register() ......................................................................
user_shell: Fix unchecked return value of osmo_fd_register()
Fixes: CID#307519: Unchecked return value (CHECKED_RETURN) Change-Id: I68ed44464573b9a6fecd07cf13fd2d6f4a1013bb --- M src/client/user_shell.c 1 file changed, 15 insertions(+), 1 deletion(-)
Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
diff --git a/src/client/user_shell.c b/src/client/user_shell.c index 5d37e97..f0dcd55 100644 --- a/src/client/user_shell.c +++ b/src/client/user_shell.c @@ -170,11 +170,15 @@ 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) {