Fix: only invoke PERROR() on failure to close sessiond_socket
[lttng-tools.git] / 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.022785 seconds and 4 git commands to generate.