From: Jérémie Galarneau Date: Wed, 11 Sep 2019 00:24:20 +0000 (-0400) Subject: Fix: only invoke PERROR() on failure to close sessiond_socket X-Git-Tag: v2.12.0-rc1~405 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b6d816c549c67b05339722a503a8272f81022dc2;p=lttng-tools.git Fix: only invoke PERROR() on failure to close sessiond_socket Signed-off-by: Jérémie Galarneau --- diff --git a/src/lib/lttng-ctl/destruction-handle.c b/src/lib/lttng-ctl/destruction-handle.c index b6a70bac6..f0ff0d4e1 100644 --- a/src/lib/lttng-ctl/destruction-handle.c +++ b/src/lib/lttng-ctl/destruction-handle.c @@ -420,7 +420,9 @@ enum lttng_error_code lttng_destroy_session_ext(const char *session_name, error: if (sessiond_socket >= 0) { ret = close(sessiond_socket); - PERROR("Failed to close the LTTng session daemon connection socket"); + if (ret < 0) { + PERROR("Failed to close the LTTng session daemon connection socket"); + } } if (handle) { lttng_destruction_handle_destroy(handle);