Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: david.goulet@polymtl.ca (David Goulet)
Subject: [ltt-dev] [RFC UST] ustctl return value
Date: Tue,  7 Sep 2010 16:40:02 -0400	[thread overview]
Message-ID: <1283892002-2728-1-git-send-email-david.goulet@polymtl.ca> (raw)

---
 ustctl/ustctl.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/ustctl/ustctl.c b/ustctl/ustctl.c
index d290975..152fc07 100644
--- a/ustctl/ustctl.c
+++ b/ustctl/ustctl.c
@@ -170,6 +170,7 @@ int main(int argc, char *argv[])
 {
 	pid_t *pidit;
 	int result;
+	int retval = EXIT_SUCCESS;
 	char *tmp;
 	struct ust_opts opts;
 
@@ -256,6 +257,7 @@ int main(int argc, char *argv[])
 					fprintf(stderr,
 						"error while trying to list markers for"
 						" PID %u\n", (unsigned int) *pidit);
+					retval = EXIT_FAILURE;
/* I'm just not sure about the right thing to do here. Let's use a simple
 * test case. We use ustctl to list markers for a certain PID
 * but this process died before we were able to list markers. Right now,
 * ustctl is returning 0 even if the command fails. So, is it good to return
 * an EXIT_FAILURE value here or not? It's not quite ustctl that failed... so...?
 *
 * I'm asking because, as now, there is NO way of knowing if the command
 * pass to ustctl was successful without "analysing" the error message
 * on stderr (string manip). For scripting, it's not good nor cool...
 */
 					break;
 				}
 				unsigned int i = 0;
@@ -356,6 +358,6 @@ int main(int argc, char *argv[])
 		free(opts.regex);
 	}
 
-	return 0;
+	return retval;
 }
 
-- 
1.7.2.2





             reply	other threads:[~2010-09-07 20:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-07 20:40 David Goulet [this message]
2010-09-07 21:04 ` Mathieu Desnoyers

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=1283892002-2728-1-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