[ltt-dev] [PATCH 2/2] Fix retval value assignment on error
Mathieu Desnoyers
compudj at krystal.dyndns.org
Fri Sep 3 14:47:40 EDT 2010
* David Goulet (david.goulet at polymtl.ca) wrote:
> Signed-off-by: David Goulet <david.goulet at polymtl.ca>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
> ---
> libust/tracectl.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/libust/tracectl.c b/libust/tracectl.c
> index 1bb841f..909cbe8 100644
> --- a/libust/tracectl.c
> +++ b/libust/tracectl.c
> @@ -282,12 +282,14 @@ static int do_cmd_get_shmid(const char *recvbuf, struct ustcomm_source *src)
> channel_and_cpu = nth_token(recvbuf, 1);
> if(channel_and_cpu == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
>
> seperate_channel_cpu(channel_and_cpu, &ch_name, &ch_cpu);
> if(ch_cpu == -1) {
> ERR("problem parsing channel name");
> + retval = -1;
> goto free_short_chan_name;
> }
>
> @@ -360,12 +362,14 @@ static int do_cmd_get_n_subbufs(const char *recvbuf, struct ustcomm_source *src)
> channel_and_cpu = nth_token(recvbuf, 1);
> if(channel_and_cpu == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
>
> seperate_channel_cpu(channel_and_cpu, &ch_name, &ch_cpu);
> if(ch_cpu == -1) {
> ERR("problem parsing channel name");
> + retval = -1;
> goto free_short_chan_name;
> }
>
> @@ -434,12 +438,14 @@ static int do_cmd_get_subbuf_size(const char *recvbuf, struct ustcomm_source *sr
> channel_and_cpu = nth_token(recvbuf, 1);
> if(channel_and_cpu == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
>
> seperate_channel_cpu(channel_and_cpu, &ch_name, &ch_cpu);
> if(ch_cpu == -1) {
> ERR("problem parsing channel name");
> + retval = -1;
> goto free_short_chan_name;
> }
>
> @@ -522,6 +528,7 @@ static int do_cmd_set_subbuf_size(const char *recvbuf, struct ustcomm_source *sr
>
> if(ch_name == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
>
> @@ -577,10 +584,12 @@ static int do_cmd_set_subbuf_num(const char *recvbuf, struct ustcomm_source *src
>
> if(ch_name == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
> if (num < 2) {
> ERR("subbuffer count should be greater than 2");
> + retval = -1;
> goto end;
> }
>
> @@ -629,12 +638,14 @@ static int do_cmd_get_subbuffer(const char *recvbuf, struct ustcomm_source *src)
> channel_and_cpu = nth_token(recvbuf, 1);
> if(channel_and_cpu == NULL) {
> ERR("cannot parse channel");
> + retval = -1;
> goto end;
> }
>
> seperate_channel_cpu(channel_and_cpu, &ch_name, &ch_cpu);
> if(ch_cpu == -1) {
> ERR("problem parsing channel name");
> + retval = -1;
> goto free_short_chan_name;
> }
>
> --
> 1.7.0.4
>
>
> _______________________________________________
> ltt-dev mailing list
> ltt-dev at lists.casi.polymtl.ca
> http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev
>
--
Mathieu Desnoyers
Operating System Efficiency R&D Consultant
EfficiOS Inc.
http://www.efficios.com
More information about the lttng-dev
mailing list