-int com_chs(int fd, int argc, char * const * argv)
-{
- int i, ret;
-
- if (argc == 1) {
- char *selector;
- mmd_lock();
- selector = para_strdup(selectors[mmd->selector_num].name);
- mmd_unlock();
- ret = send_va_buffer(fd, "%s\n", selector);
- free(selector);
- return ret;
- }
- for (i = 0; selectors[i].name; i++) {
- if (strcmp(selectors[i].name, argv[1]))
- continue;
- mmd_lock();
- mmd->selector_change = i;
- mmd->events++;
- mmd_unlock();
- return 1;
- }
- return -E_BAD_SELECTOR;
-}
-