From 68313703b8a81b3710aabef6dd73de88b218199e Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Fri, 18 Sep 2015 15:35:21 -0400 Subject: [PATCH] Fix: Only log app handle release on failure MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- src/bin/lttng-sessiond/ust-app.c | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 53a6f9317..bbba4a604 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -3482,7 +3482,9 @@ int ust_app_list_events(struct lttng_event **events) } free(tmp_event); release_ret = ustctl_release_handle(app->sock, handle); - if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) { + if (release_ret < 0 && + release_ret != -LTTNG_UST_ERR_EXITING && + release_ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret); } pthread_mutex_unlock(&app->sock_lock); @@ -3507,7 +3509,9 @@ int ust_app_list_events(struct lttng_event **events) free(tmp_event); ret = -ENOMEM; release_ret = ustctl_release_handle(app->sock, handle); - if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) { + if (release_ret < 0 && + release_ret != -LTTNG_UST_ERR_EXITING && + release_ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret); } pthread_mutex_unlock(&app->sock_lock); @@ -3528,7 +3532,7 @@ int ust_app_list_events(struct lttng_event **events) } ret = ustctl_release_handle(app->sock, handle); pthread_mutex_unlock(&app->sock_lock); - if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) { + if (ret < 0 && ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, ret); } } @@ -3610,7 +3614,9 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) free(tmp_event); release_ret = ustctl_release_handle(app->sock, handle); pthread_mutex_unlock(&app->sock_lock); - if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) { + if (release_ret < 0 && + release_ret != -LTTNG_UST_ERR_EXITING && + release_ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret); } goto rcu_error; @@ -3635,7 +3641,9 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) ret = -ENOMEM; release_ret = ustctl_release_handle(app->sock, handle); pthread_mutex_unlock(&app->sock_lock); - if (release_ret != -LTTNG_UST_ERR_EXITING && release_ret != -EPIPE) { + if (release_ret && + release_ret != -LTTNG_UST_ERR_EXITING && + release_ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, release_ret); } goto rcu_error; @@ -3661,7 +3669,9 @@ int ust_app_list_event_fields(struct lttng_event_field **fields) } ret = ustctl_release_handle(app->sock, handle); pthread_mutex_unlock(&app->sock_lock); - if (ret != -LTTNG_UST_ERR_EXITING && ret != -EPIPE) { + if (ret < 0 && + ret != -LTTNG_UST_ERR_EXITING && + ret != -EPIPE) { ERR("Error releasing app handle for app %d with ret %d", app->sock, ret); } } -- 2.34.1