From: david.goulet@polymtl.ca (David Goulet)
Subject: [ltt-dev] [PATCH 2/2] Fix retval value assignment on error
Date: Fri, 3 Sep 2010 12:37:51 -0400 [thread overview]
Message-ID: <1283531871-10001-2-git-send-email-david.goulet@polymtl.ca> (raw)
In-Reply-To: <1283531871-10001-1-git-send-email-david.goulet@polymtl.ca>
Signed-off-by: David Goulet <david.goulet at polymtl.ca>
---
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
next prev parent reply other threads:[~2010-09-03 16:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-03 16:37 [ltt-dev] [PATCH 1/2] Fix asprintf warning ignoring return value David Goulet
2010-09-03 16:37 ` David Goulet [this message]
2010-09-03 18:47 ` [ltt-dev] [PATCH 2/2] Fix retval value assignment on error Mathieu Desnoyers
2010-09-06 14:05 ` Nils Carlson
2010-09-03 18:52 ` [ltt-dev] [PATCH 1/2] Fix asprintf warning ignoring return value Mathieu Desnoyers
2010-09-03 19:19 ` David Goulet
2010-09-03 20:37 ` Mathieu Desnoyers
2010-09-09 6:23 ` Pierre-Marc Fournier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1283531871-10001-2-git-send-email-david.goulet@polymtl.ca \
--to=david.goulet@polymtl.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox