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.11.0-rc4~58 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=7f5713c9163221f77b19102e7bf3ea8f3272fbb4;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);