Ignore:
Timestamp:
2009-03-12T17:48:13Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
099aa78
Parents:
67a88c3
Message:

avoid page fault on exit command
cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/console/kconsole.c

    r67a88c3 ra02e383  
    296296}
    297297
    298 static char *clever_readline(const char *prompt, chardev_t *input)
     298static char *clever_readline(const char *prompt, indev_t *input)
    299299{
    300300        static int histposition = 0;
     
    457457}
    458458
     459bool kconsole_check_poll(void)
     460{
     461        return check_poll(stdin);
     462}
     463
    459464/** Kernel console prompt.
    460465 *
     
    470475        count_t len;
    471476        char *cmdline;
    472 
     477       
    473478        if (!stdin) {
    474479                LOG("No stdin for kernel console");
     
    481486        if (kcon)
    482487                _getc(stdin);
     488        else
     489                printf("Type \"exit\" to leave the console.\n");
    483490       
    484491        while (true) {
     
    488495                        continue;
    489496               
     497                if ((!kcon) && (len == 4) && (strncmp(cmdline, "exit", 4) == 0))
     498                        break;
     499               
    490500                cmd_info = parse_cmdline(cmdline, len);
    491501                if (!cmd_info)
    492502                        continue;
    493                
    494                 if ((!kcon)
    495                     && (strncmp(cmd_info->name, "exit", min(strlen(cmd_info->name), 5)) == 0))
    496                         break;
    497503               
    498504                (void) cmd_info->func(cmd_info->argv);
Note: See TracChangeset for help on using the changeset viewer.