aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-26 15:39:52 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-01 15:52:53 +0100
commita47c8a3f3f1ccbf8963f2a6379562bcf52a381a6 (patch)
tree29a9a6b9e511f21319f9fe33ad4729c8e5f10d33 /examples
parent046b12fa88ba8171b44302a55fbd624ef3b10e8a (diff)
stream-client: Check for osmo_fd_register() return value
Change-Id: I1b5fa97d14e69ff502b6deba0fd898a01e53420f Fixes: Coverity CID 57633
Diffstat (limited to 'examples')
-rw-r--r--examples/stream-client.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/examples/stream-client.c b/examples/stream-client.c
index 112d78b..c54db02 100644
--- a/examples/stream-client.c
+++ b/examples/stream-client.c
@@ -93,6 +93,7 @@ static int kbd_cb(struct osmo_fd *fd, unsigned int what)
int main(void)
{
struct osmo_fd *kbd_ofd;
+ int rc;
tall_test = talloc_named_const(NULL, 1, "osmo_stream_cli_test");
@@ -127,7 +128,11 @@ int main(void)
kbd_ofd->when = BSC_FD_READ;
kbd_ofd->data = conn;
kbd_ofd->cb = kbd_cb;
- osmo_fd_register(kbd_ofd);
+ rc = osmo_fd_register(kbd_ofd);
+ if (rc < 0) {
+ LOGP(DSTREAMTEST, LOGL_ERROR, "FD Register\n");
+ exit(EXIT_FAILURE);
+ }
LOGP(DSTREAMTEST, LOGL_NOTICE, "Entering main loop\n");