From: David Goulet Date: Mon, 5 Nov 2012 22:03:19 +0000 (-0500) Subject: Fix: Channel creation error return code was not set X-Git-Tag: v2.1.0-rc7~21 X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=commitdiff_plain;h=3c14c33fe61a2011881075506e6946ca5cdf23c1 Fix: Channel creation error return code was not set Signed-off-by: David Goulet --- diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index e0562ed4e..4cae85d6e 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -1983,6 +1983,7 @@ int ust_app_disable_all_event_glb(struct ltt_ust_session *usess, int ust_app_create_channel_glb(struct ltt_ust_session *usess, struct ltt_ust_channel *uchan) { + int ret = 0; struct lttng_ht_iter iter; struct ust_app *app; struct ust_app_session *ua_sess; @@ -2014,9 +2015,11 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess, ua_sess = create_ust_app_session(usess, app); if (ua_sess == NULL) { /* The malloc() failed. */ + ret = -1; goto error; } else if (ua_sess == (void *) -1UL) { /* The application's socket is not valid. Contiuing */ + ret = -1; continue; } @@ -2024,16 +2027,15 @@ int ust_app_create_channel_glb(struct ltt_ust_session *usess, ua_chan = create_ust_app_channel(ua_sess, uchan, app); if (ua_chan == NULL) { /* Major problem here and it's maybe the tracer or malloc() */ + ret = -1; goto error; } } rcu_read_unlock(); - return 0; - error: - return -1; + return ret; } /*