Newer
Older
if (e)
e->inuse++;
ast_pthread_mutex_unlock(&clilock);
if (e) {
switch(e->handler(fd, x, argv)) {
case RESULT_SHOWUSAGE:
ast_cli(fd, e->usage);
break;
}
} else
ast_cli(fd, "No such command '%s' (type 'help' for help)\n", find_best(argv));
if (e) {
ast_pthread_mutex_lock(&clilock);
e->inuse--;
ast_pthread_mutex_unlock(&clilock);
}
}
free(dup);
} else {
ast_log(LOG_WARNING, "Out of memory\n");
return -1;
}
return 0;
}