- r = read(fd, line, sizeof(line) - 1);
- line[r] = '\0';
- close(fd);
-
- regcomp(&pat_cmdline, "console=([a-zA-Z0-9]*)", REG_EXTENDED);
- if (regexec(&pat_cmdline, line, 2, matches, 0))
- goto err_out;
- line[matches[1].rm_eo] = '\0';
- tty = &line[matches[1].rm_so];
-
- chdir("/dev");
- i = stat(tty, &s);
- chdir("/");
- if (i) {
- DEBUG(2, "skipping %s\n", tty);
- goto err_out;