pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-netif/+/38986?usp=email )
Change subject: stream_cli: Explicitly ignore return code of internal functions
......................................................................
stream_cli: Explicitly ignore return code of internal functions
Make coverity happy.
We don't really care about the return code of the stream_cli_reconnect()
function in the code path, since the return value is only used
internally/privately in the object and there's no further access/use of
the object after calling it in osmo_stream_cli_reconnect().
Change-Id: I61b7001047e8eb1e1347f532d67f3f00dc8f67ec
---
M src/stream_cli.c
1 file changed, 13 insertions(+), 13 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/86/38986/1
diff --git a/src/stream_cli.c b/src/stream_cli.c
index 85ede60..fe62607 100644
--- a/src/stream_cli.c
+++ b/src/stream_cli.c
@@ -251,7 +251,7 @@
* we close any existing connection (if any) and schedule a re-connect timer */
void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli)
{
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
}
/*! Check if Osmocom Stream Client is in connected state.
@@ -383,7 +383,7 @@
return 0;
}
msgb_free(msg);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return 0;
}
@@ -419,13 +419,13 @@
if (ret < 0) {
LOGSCLI(cli, LOGL_ERROR, "connect failed (%d)\n", res);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return;
}
ret = getsockopt(fd, SOL_SOCKET, SO_ERROR, &error, &len);
if (ret >= 0 && error > 0) {
LOGSCLI(cli, LOGL_ERROR, "connect so_error (%d)\n", error);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return;
}
@@ -458,7 +458,7 @@
if (cli->connect_cb)
cli->connect_cb(cli);
cli->in_cb_mask &= ~IN_CB_MASK_CONNECT_CB;
- free_delayed_if_needed(cli);
+ (void)free_delayed_if_needed(cli);
}
static int osmo_stream_cli_fd_cb(struct osmo_fd *ofd, unsigned int what)
@@ -467,7 +467,7 @@
switch (cli->state) {
case STREAM_CLI_STATE_CONNECTING:
- stream_cli_handle_connecting(cli, 0);
+ (void)stream_cli_handle_connecting(cli, 0);
break;
case STREAM_CLI_STATE_CONNECTED:
if (what & OSMO_FD_READ) {
@@ -558,7 +558,7 @@
cli->iofd_read_cb(cli, res, msg);
cli->in_cb_mask &= ~IN_CB_MASK_READ_CB;
OSMO_ASSERT(cli->in_cb_mask == 0);
- free_delayed_if_needed(cli);
+ (void)free_delayed_if_needed(cli);
break;
default:
osmo_panic("%s() called with unexpected state %d\n", __func__,
cli->state);
@@ -576,7 +576,7 @@
case STREAM_CLI_STATE_CONNECTED:
if (msg && res <= 0) {
LOGSCLI(cli, LOGL_ERROR, "received error %d in response to send\n", res);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
}
break;
default:
@@ -630,7 +630,7 @@
cli->iofd_read_cb(cli, res, msg);
cli->in_cb_mask &= ~IN_CB_MASK_READ_CB;
OSMO_ASSERT(cli->in_cb_mask == 0);
- free_delayed_if_needed(cli);
+ (void)free_delayed_if_needed(cli);
break;
default:
osmo_panic("%s() called with unexpected state %d\n", __func__,
cli->state);
@@ -1026,7 +1026,7 @@
if (ret < 0) {
LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
if (reconnect)
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return ret;
}
osmo_fd_setup(&cli->ofd, ret, OSMO_FD_READ | OSMO_FD_WRITE,
osmo_stream_cli_fd_cb, cli, 0);
@@ -1199,7 +1199,7 @@
if (ret < 0) {
LOGSCLI(cli, LOGL_ERROR, "connect: socket creation error (%d)\n", ret);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return ret;
}
@@ -1368,11 +1368,11 @@
LOGSCLI(cli, LOGL_ERROR, "lost connection with srv (%d)\n", errno);
else
LOGSCLI(cli, LOGL_ERROR, "recv failed (%d)\n", errno);
- stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return ret;
} else if (ret == 0) {
LOGSCLI(cli, LOGL_ERROR, "connection closed with srv\n");
- osmo_stream_cli_reconnect(cli);
+ (void)stream_cli_reconnect(cli);
return ret;
}
msgb_put(msg, ret);
--
To view, visit
https://gerrit.osmocom.org/c/libosmo-netif/+/38986?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I61b7001047e8eb1e1347f532d67f3f00dc8f67ec
Gerrit-Change-Number: 38986
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>