X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fust-app.c;h=f0af340770ca59bd98ddda1d48e0ffd4d01bd262;hb=6b10b3b01eb754c0c3149490f700763dbac60ed5;hp=53a6f93178f8616e7302733b9f0a9ef5d6566cd2;hpb=700c5a9d4dc7b552926b8ddcbba91cc13312aba0;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/ust-app.c b/src/bin/lttng-sessiond/ust-app.c index 53a6f9317..f0af34077 100644 --- a/src/bin/lttng-sessiond/ust-app.c +++ b/src/bin/lttng-sessiond/ust-app.c @@ -15,7 +15,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #include #include @@ -3482,7 +3481,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 +3508,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 +3531,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 +3613,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 +3640,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 +3668,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); } }