From: David Goulet Date: Tue, 3 Apr 2012 18:29:01 +0000 (-0400) Subject: Fix: return value signedness X-Git-Tag: v2.0.1~16 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=dab4fc145b926b13e1d1ba6c6047a1e2a9c46002;p=lttng-tools.git Fix: return value signedness Also remove repeated include headers. Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/session.c b/src/bin/lttng-sessiond/session.c index cf2ef463e..bcdd78d50 100644 --- a/src/bin/lttng-sessiond/session.c +++ b/src/bin/lttng-sessiond/session.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include @@ -55,7 +54,7 @@ static struct ltt_session_list ltt_session_list = { * The caller MUST acquire the session list lock before. * Returns the unique identifier for the session. */ -static int add_session_list(struct ltt_session *ls) +static unsigned int add_session_list(struct ltt_session *ls) { cds_list_add(&ls->list, <t_session_list.head); return ++ltt_session_list.count; @@ -230,7 +229,7 @@ int session_create(char *name, char *path, uid_t uid, gid_t gid) new_session->id = add_session_list(new_session); session_unlock_list(); - DBG("Tracing session %s created in %s with ID %d by UID %d GID %d", + DBG("Tracing session %s created in %s with ID %u by UID %d GID %d", name, path, new_session->id, new_session->uid, new_session->gid); diff --git a/src/bin/lttng-sessiond/session.h b/src/bin/lttng-sessiond/session.h index fd8f9116d..8294a83fd 100644 --- a/src/bin/lttng-sessiond/session.h +++ b/src/bin/lttng-sessiond/session.h @@ -18,8 +18,6 @@ #ifndef _LTT_SESSION_H #define _LTT_SESSION_H -#include -#include #include #include "trace-kernel.h" @@ -68,7 +66,7 @@ struct ltt_session { pthread_mutex_t lock; struct cds_list_head list; int enabled; /* enabled/started flag */ - int id; /* session unique identifier */ + unsigned int id; /* session unique identifier */ /* UID/GID of the user owning the session */ uid_t uid; gid_t gid; diff --git a/src/bin/lttng-sessiond/trace-kernel.h b/src/bin/lttng-sessiond/trace-kernel.h index 5a8bcdbd4..d6f67265e 100644 --- a/src/bin/lttng-sessiond/trace-kernel.h +++ b/src/bin/lttng-sessiond/trace-kernel.h @@ -18,7 +18,6 @@ #ifndef _LTT_TRACE_KERNEL_H #define _LTT_TRACE_KERNEL_H -#include #include #include diff --git a/src/bin/lttng-sessiond/trace-ust.c b/src/bin/lttng-sessiond/trace-ust.c index 7b5c3c788..c8b3b72f9 100644 --- a/src/bin/lttng-sessiond/trace-ust.c +++ b/src/bin/lttng-sessiond/trace-ust.c @@ -85,8 +85,8 @@ error: * * Return pointer to structure or NULL. */ -struct ltt_ust_session *trace_ust_create_session(char *path, int session_id, - struct lttng_domain *domain) +struct ltt_ust_session *trace_ust_create_session(char *path, + unsigned int session_id, struct lttng_domain *domain) { int ret; struct ltt_ust_session *lus; @@ -544,7 +544,7 @@ void trace_ust_destroy_session(struct ltt_ust_session *session) rcu_read_lock(); - DBG2("Trace UST destroy session %d", session->id); + DBG2("Trace UST destroy session %u", session->id); /* Cleaning up UST domain */ destroy_domain_global(&session->domain_global); diff --git a/src/bin/lttng-sessiond/trace-ust.h b/src/bin/lttng-sessiond/trace-ust.h index 4513bafee..c59490b2a 100644 --- a/src/bin/lttng-sessiond/trace-ust.h +++ b/src/bin/lttng-sessiond/trace-ust.h @@ -20,7 +20,6 @@ #include #include -#include #include #include @@ -127,8 +126,8 @@ struct ltt_ust_channel *trace_ust_find_channel_by_name(struct lttng_ht *ht, /* * Create functions malloc() the data structure. */ -struct ltt_ust_session *trace_ust_create_session(char *path, int session_id, - struct lttng_domain *domain); +struct ltt_ust_session *trace_ust_create_session(char *path, + unsigned int session_id, struct lttng_domain *domain); struct ltt_ust_channel *trace_ust_create_channel(struct lttng_channel *attr, char *path); struct ltt_ust_event *trace_ust_create_event(struct lttng_event *ev);