Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: soariez@gmail.com (Zifei Tong)
Subject: [lttng-dev] [PATCH lttng-tools 1/2] Fix: implicit conversion of enum types in consumer
Date: Tue, 25 Feb 2014 23:41:28 +0800	[thread overview]
Message-ID: <1393342889-61215-1-git-send-email-soariez@gmail.com> (raw)

Fix implicit conversions from enumeration type 'enum lttng_error_code'
to enumeration type 'enum lttcomm_return_code' found by clang.

Signed-off-by: Zifei Tong <soariez at gmail.com>
---
 src/common/kernel-consumer/kernel-consumer.c | 12 ++++++------
 src/common/ust-consumer/ust-consumer.c       |  8 ++++----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/common/kernel-consumer/kernel-consumer.c b/src/common/kernel-consumer/kernel-consumer.c
index ab4f604..388ef11 100644
--- a/src/common/kernel-consumer/kernel-consumer.c
+++ b/src/common/kernel-consumer/kernel-consumer.c
@@ -561,7 +561,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 			 * happens while tearing down.
 			 */
 			ERR("Unable to find channel key %" PRIu64, msg.u.stream.channel_key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
@@ -764,7 +764,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 			 */
 			ERR("Unable to find channel key %" PRIu64,
 					msg.u.sent_streams.channel_key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
@@ -815,7 +815,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		relayd = consumer_find_relayd(index);
 		if (relayd == NULL) {
 			DBG("Unable to find relayd %" PRIu64, index);
-			ret_code = LTTNG_ERR_NO_CONSUMER;
+			ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
 		}
 
 		/*
@@ -874,7 +874,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					msg.u.snapshot_channel.relayd_id, ctx);
 			if (ret < 0) {
 				ERR("Snapshot metadata failed");
-				ret_code = LTTNG_ERR_KERN_META_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA;
 			}
 		} else {
 			ret = lttng_kconsumer_snapshot_channel(msg.u.snapshot_channel.key,
@@ -884,7 +884,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot channel failed");
-				ret_code = LTTNG_ERR_KERN_CHAN_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			}
 		}
 
@@ -905,7 +905,7 @@ int lttng_kconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		channel = consumer_find_channel(key);
 		if (!channel) {
 			ERR("Kernel consumer destroy channel %" PRIu64 " not found", key);
-			ret_code = LTTNG_ERR_KERN_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 		}
 
 		health_code_update();
diff --git a/src/common/ust-consumer/ust-consumer.c b/src/common/ust-consumer/ust-consumer.c
index 0955e66..d19ce57 100644
--- a/src/common/ust-consumer/ust-consumer.c
+++ b/src/common/ust-consumer/ust-consumer.c
@@ -1145,7 +1145,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		relayd = consumer_find_relayd(index);
 		if (relayd == NULL) {
 			DBG("Unable to find relayd %" PRIu64, index);
-			ret_code = LTTNG_ERR_NO_CONSUMER;
+			ret_code = LTTCOMM_CONSUMERD_RELAYD_FAIL;
 		}
 
 		/*
@@ -1326,7 +1326,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 		channel = consumer_find_channel(key);
 		if (!channel) {
 			ERR("UST consumer get channel key %" PRIu64 " not found", key);
-			ret_code = LTTNG_ERR_UST_CHAN_NOT_FOUND;
+			ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			goto end_msg_sessiond;
 		}
 
@@ -1482,7 +1482,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot metadata failed");
-				ret_code = LTTNG_ERR_UST_META_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA;
 			}
 		} else {
 			ret = snapshot_channel(msg.u.snapshot_channel.key,
@@ -1492,7 +1492,7 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
 					ctx);
 			if (ret < 0) {
 				ERR("Snapshot channel failed");
-				ret_code = LTTNG_ERR_UST_CHAN_FAIL;
+				ret_code = LTTCOMM_CONSUMERD_CHANNEL_FAIL;
 			}
 		}
 
-- 
1.8.3.4 (Apple Git-47)




             reply	other threads:[~2014-02-25 15:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-25 15:41 Zifei Tong [this message]
2014-02-25 15:41 ` [lttng-dev] [PATCH lttng-tools 2/2] Add missing error message for lttcomm_return_code Zifei Tong

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=1393342889-61215-1-git-send-email-soariez@gmail.com \
    --to=soariez@gmail.com \
    /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