lib: rename INVALID_OBJECT status to UNKNOWN_OBJECT
[babeltrace.git] / src / cli / babeltrace2.c
index 9699b0c3b5e46fba695fbbf6d4614df0f413f559..8301fba870d676097e90a7f51427bcd97ef6c997 100644 (file)
@@ -57,7 +57,6 @@ static const char* log_level_env_var_names[] = {
 
 /* Application's interrupter (owned by this) */
 static bt_interrupter *the_interrupter;
-static volatile bool interrupted = false;
 
 #ifdef __MINGW32__
 
@@ -69,7 +68,6 @@ BOOL WINAPI signal_handler(DWORD signal) {
                bt_interrupter_set(the_interrupter);
        }
 
-       interrupted = true;
        return TRUE;
 }
 
@@ -93,8 +91,6 @@ void signal_handler(int signum)
        if (the_interrupter) {
                bt_interrupter_set(the_interrupter);
        }
-
-       interrupted = true;
 }
 
 static
@@ -135,16 +131,6 @@ int query(struct bt_config *cfg, const bt_component_class *comp_cls,
 
        bt_query_executor_add_interrupter(query_exec, the_interrupter);
 
-       if (interrupted) {
-               BT_CLI_LOGW_APPEND_CAUSE(
-                       "Interrupted by user before executing the query: "
-                       "comp-cls-addr=%p, comp-cls-name=\"%s\", "
-                       "query-obj=\"%s\"", comp_cls,
-                       bt_component_class_get_name(comp_cls), obj);
-               *fail_reason = "interrupted by user";
-               goto error;
-       }
-
        while (true) {
                query_status = bt_query_executor_query(
                        query_exec, comp_cls, obj, params,
@@ -187,11 +173,8 @@ int query(struct bt_config *cfg, const bt_component_class *comp_cls,
                        }
 
                        goto error;
-               case BT_QUERY_EXECUTOR_QUERY_STATUS_INVALID_OBJECT:
-                       *fail_reason = "invalid or unknown query object";
-                       goto error;
-               case BT_QUERY_EXECUTOR_QUERY_STATUS_INVALID_PARAMS:
-                       *fail_reason = "invalid query parameters";
+               case BT_QUERY_EXECUTOR_QUERY_STATUS_UNKNOWN_OBJECT:
+                       *fail_reason = "unknown query object";
                        goto error;
                case BT_QUERY_EXECUTOR_QUERY_STATUS_MEMORY_ERROR:
                        *fail_reason = "not enough memory";
@@ -2311,7 +2294,7 @@ int cmd_run(struct bt_config *cfg)
                goto error;
        }
 
-       if (interrupted) {
+       if (bt_interrupter_is_set(the_interrupter)) {
                BT_CLI_LOGW_APPEND_CAUSE(
                        "Interrupted by user before creating components.");
                goto error;
@@ -2325,7 +2308,7 @@ int cmd_run(struct bt_config *cfg)
                goto error;
        }
 
-       if (interrupted) {
+       if (bt_interrupter_is_set(the_interrupter)) {
                BT_CLI_LOGW_APPEND_CAUSE(
                        "Interrupted by user before connecting components.");
                goto error;
@@ -2340,12 +2323,6 @@ int cmd_run(struct bt_config *cfg)
                goto error;
        }
 
-       if (interrupted) {
-               BT_CLI_LOGW_APPEND_CAUSE(
-                       "Interrupted by user before running the graph.");
-               goto error;
-       }
-
        BT_LOGI_STR("Running the graph.");
 
        /* Run the graph */
This page took 0.036906 seconds and 4 git commands to generate.