Clean-up: kernel-consumer: fix -Wshadow issues in lttng_kconsumer_recv_cmd
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 31 Mar 2021 15:10:30 +0000 (11:10 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 13 Apr 2021 20:21:33 +0000 (16:21 -0400)
commit0c5b37182381d8350ead74f5c10f272c746e3277
treedf5cc1feca7d66f3cc979a4006b244174902f234
parent9074be22cad1e15ff91ac1147158ce93a33f29ad
Clean-up: kernel-consumer: fix -Wshadow issues in lttng_kconsumer_recv_cmd

There is a "ret" variable declared at the top and used throughout, but
there are also some other "ret" variables declared in narrower scopes.

Most of the time, the return value is not communicated from the "case"s
to the return value of the function. On failure, they goto an error
label which overrides ret to -1. There is one exception in "case
LTTNG_CONSUMER_ADD_STREAM", which goes directly to label end, not sure
if that's on purpose or not.

So what I did is: declare variables in narrower scopes when possible,
name them according to their intended use (e.g. ret_send, ret_recv). In
the end, there is no variable simply named "ret". The variable holding
the function's return value is "ret_func".

Change-Id: Ic02067c23757bd98d4b2d3d0f2b77384b4b0d743
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/kernel-consumer/kernel-consumer.c
This page took 0.025114 seconds and 4 git commands to generate.