Fix lttng UI: fix arg parsing, round size to next power of two
[lttng-tools.git] / src / bin / lttng / commands / destroy.c
index fea96f1757907178ea8e89b7ee6a21bdd18c27be..3fb5fb232edb16184a4a7574de9b6e623668959f 100644 (file)
@@ -74,10 +74,11 @@ static int destroy_session(const char *session_name)
        ret = lttng_destroy_session(session_name);
        if (ret < 0) {
                switch (-ret) {
-               case LTTCOMM_SESS_NOT_FOUND:
+               case LTTNG_ERR_SESS_NOT_FOUND:
                        WARN("Session name %s not found", session_name);
                        break;
                default:
+                       ERR("%s", lttng_strerror(ret));
                        break;
                }
                goto error;
@@ -103,7 +104,11 @@ static int destroy_all_sessions()
        count = lttng_list_sessions(&sessions);
        if (count == 0) {
                MSG("No session found, nothing to do.");
+       } else if (count < 0) {
+               ERR("%s", lttng_strerror(ret));
+               goto error;
        }
+
        for (i = 0; i < count; i++) {
                ret = destroy_session(sessions[i].name);
                if (ret < 0) {
This page took 0.023493 seconds and 4 git commands to generate.