Beispiel #1
0
void execute_one_command(void)
{
    int ret, i;
    char cmd_str[256] = "";

    if (!cur_action || !cur_command || is_last_command(cur_action, cur_command)) {
        cur_action = action_remove_queue_head();
        cur_command = NULL;
        if (!cur_action)
            return;
        INFO("processing action %p (%s)\n", cur_action, cur_action->name);
        cur_command = get_first_command(cur_action);
    } else {
        cur_command = get_next_command(cur_action, cur_command);
    }

    if (!cur_command)
        return;

    ret = cur_command->func(cur_command->nargs, cur_command->args);
    if (klog_get_level() >= KLOG_INFO_LEVEL) {
        for (i = 0; i < cur_command->nargs; i++) {
            strlcat(cmd_str, cur_command->args[i], sizeof(cmd_str));
            if (i < cur_command->nargs - 1) {
                strlcat(cmd_str, " ", sizeof(cmd_str));
            }
        }
        INFO("command '%s' action=%s status=%d (%s:%d)\n",
             cmd_str, cur_action ? cur_action->name : "", ret, cur_command->filename,
             cur_command->line);
    }
}
void execute_one_command(void)
{
    int ret;

    if (!cur_action || !cur_command || is_last_command(cur_action, cur_command)) {
        cur_action = action_remove_queue_head();
        cur_command = NULL;
        if (!cur_action)
            return;
        INFO("processing action %p (%s)\n", cur_action, cur_action->name);
        cur_command = get_first_command(cur_action);
    } else {
        cur_command = get_next_command(cur_action, cur_command);
    }

    if (!cur_command)
        return;

    ret = cur_command->func(cur_command->nargs, cur_command->args);
    INFO("command '%s' r=%d\n", cur_command->args[0], ret);
}
Beispiel #3
0
void execute_one_command(void)
{
    int ret;

    if (!cur_action || !cur_command || is_last_command(cur_action, cur_command)) {
        cur_action = action_remove_queue_head();
        cur_command = NULL;
        if (!cur_action)
            return;
#ifdef INIT_ENG_BUILD
        ERROR("processing action %p (%s)\n", cur_action, cur_action->name);
#else
        INFO("processing action %p (%s)\n", cur_action, cur_action->name);
#endif
        cur_command = get_first_command(cur_action);
    } else {
        cur_command = get_next_command(cur_action, cur_command);
    }

    if (!cur_command)
        return;

    ret = cur_command->func(cur_command->nargs, cur_command->args);
#ifdef INIT_ENG_BUILD
    if(cur_command->nargs > 3)
    ERROR("command '%s %s %s %s' r=%d\n", cur_command->args[0], cur_command->args[1], cur_command->args[2], cur_command->args[3], ret);
    else if(cur_command->nargs > 2)
    ERROR("command '%s %s %s' r=%d\n", cur_command->args[0], cur_command->args[1], cur_command->args[2], ret);
    else if(cur_command->nargs > 1)
    ERROR("command '%s %s' r=%d\n", cur_command->args[0], cur_command->args[1], ret);
    else
    ERROR("command '%s' r=%d\n", cur_command->args[0], ret);
#else
    INFO("command '%s' r=%d\n", cur_command->args[0], ret);
#endif
}