Fix: only invoke PERROR() on failure to close sessiond_socket
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 11 Sep 2019 00:24:20 +0000 (20:24 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 19 Sep 2019 19:31:48 +0000 (15:31 -0400)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/lib/lttng-ctl/destruction-handle.c

index b6a70bac6803cf852933ffb87d25398498a86b57..f0ff0d4e170e0e4bf2178b0075e91047b3170a4e 100644 (file)
@@ -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);
This page took 0.026109 seconds and 4 git commands to generate.