Rev 4173 | Rev 4216 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 4173 | Rev 4207 | ||
---|---|---|---|
Line 517... | Line 517... | ||
517 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
517 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
518 | cmd_info_t *hlp; |
518 | cmd_info_t *hlp; |
519 | hlp = list_get_instance(cur, cmd_info_t, link); |
519 | hlp = list_get_instance(cur, cmd_info_t, link); |
520 | 520 | ||
521 | spinlock_lock(&hlp->lock); |
521 | spinlock_lock(&hlp->lock); |
522 | if (strlen(hlp->name) > len) |
522 | if (str_size(hlp->name) > len) |
523 | len = strlen(hlp->name); |
523 | len = str_size(hlp->name); |
524 | spinlock_unlock(&hlp->lock); |
524 | spinlock_unlock(&hlp->lock); |
525 | } |
525 | } |
526 | 526 | ||
527 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
527 | for (cur = cmd_head.next; cur != &cmd_head; cur = cur->next) { |
528 | cmd_info_t *hlp; |
528 | cmd_info_t *hlp; |
Line 589... | Line 589... | ||
589 | cmd_info_t *hlp; |
589 | cmd_info_t *hlp; |
590 | 590 | ||
591 | hlp = list_get_instance(cur, cmd_info_t, link); |
591 | hlp = list_get_instance(cur, cmd_info_t, link); |
592 | spinlock_lock(&hlp->lock); |
592 | spinlock_lock(&hlp->lock); |
593 | 593 | ||
594 | if (strncmp(hlp->name, (const char *) argv->buffer, strlen(hlp->name)) == 0) { |
594 | if (strncmp(hlp->name, (const char *) argv->buffer, str_size(hlp->name)) == 0) { |
595 | printf("%s - %s\n", hlp->name, hlp->description); |
595 | printf("%s - %s\n", hlp->name, hlp->description); |
596 | if (hlp->help) |
596 | if (hlp->help) |
597 | hlp->help(); |
597 | hlp->help(); |
598 | spinlock_unlock(&hlp->lock); |
598 | spinlock_unlock(&hlp->lock); |
599 | break; |
599 | break; |
Line 970... | Line 970... | ||
970 | int cmd_tests(cmd_arg_t *argv) |
970 | int cmd_tests(cmd_arg_t *argv) |
971 | { |
971 | { |
972 | size_t len = 0; |
972 | size_t len = 0; |
973 | test_t *test; |
973 | test_t *test; |
974 | for (test = tests; test->name != NULL; test++) { |
974 | for (test = tests; test->name != NULL; test++) { |
975 | if (strlen(test->name) > len) |
975 | if (str_size(test->name) > len) |
976 | len = strlen(test->name); |
976 | len = str_size(test->name); |
977 | } |
977 | } |
978 | 978 | ||
979 | for (test = tests; test->name != NULL; test++) |
979 | for (test = tests; test->name != NULL; test++) |
980 | printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); |
980 | printf("%-*s %s%s\n", len, test->name, test->desc, (test->safe ? "" : " (unsafe)")); |
981 | 981 |