Now starts a login shell.
Renamed console_reader() function to keyboard_reader(). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -34,7 +34,7 @@ struct console theconsole;
|
|||||||
|
|
||||||
|
|
||||||
static int32
|
static int32
|
||||||
console_reader(void *arg)
|
keyboard_reader(void *arg)
|
||||||
{
|
{
|
||||||
struct console *con = (struct console *)arg;
|
struct console *con = (struct console *)arg;
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
@@ -96,17 +96,17 @@ start_console(struct console *con)
|
|||||||
if (dir != NULL) {
|
if (dir != NULL) {
|
||||||
struct dirent *entry;
|
struct dirent *entry;
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
||||||
while ((entry = readdir(dir)) != NULL) {
|
while ((entry = readdir(dir)) != NULL) {
|
||||||
if (entry->d_name[0] == '.')
|
if (entry->d_name[0] == '.')
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
sprintf(name, "/dev/pt/%s", entry->d_name);
|
sprintf(name, "/dev/pt/%s", entry->d_name);
|
||||||
|
|
||||||
con->tty_master_fd = open(name, O_RDWR);
|
con->tty_master_fd = open(name, O_RDWR);
|
||||||
if (con->tty_master_fd >= 0) {
|
if (con->tty_master_fd >= 0) {
|
||||||
sprintf(name, "/dev/tt/%s", entry->d_name);
|
sprintf(name, "/dev/tt/%s", entry->d_name);
|
||||||
|
|
||||||
con->tty_slave_fd = open(name, O_RDWR);
|
con->tty_slave_fd = open(name, O_RDWR);
|
||||||
if (con->tty_slave_fd < 0) {
|
if (con->tty_slave_fd < 0) {
|
||||||
fprintf(stderr, "Could not open tty!\n");
|
fprintf(stderr, "Could not open tty!\n");
|
||||||
@@ -133,7 +133,7 @@ start_console(struct console *con)
|
|||||||
if (con->tty_master_fd < 0 || con->tty_slave_fd < 0)
|
if (con->tty_master_fd < 0 || con->tty_slave_fd < 0)
|
||||||
return -4;
|
return -4;
|
||||||
|
|
||||||
con->keyboard_reader = spawn_thread(&console_reader, "console reader", B_URGENT_DISPLAY_PRIORITY, con);
|
con->keyboard_reader = spawn_thread(&keyboard_reader, "console reader", B_URGENT_DISPLAY_PRIORITY, con);
|
||||||
if (con->keyboard_reader < 0)
|
if (con->keyboard_reader < 0)
|
||||||
return -7;
|
return -7;
|
||||||
|
|
||||||
@@ -202,9 +202,8 @@ main(void)
|
|||||||
const char *argv[3];
|
const char *argv[3];
|
||||||
|
|
||||||
argv[0] = "/bin/sh";
|
argv[0] = "/bin/sh";
|
||||||
// argv[1] = "-s";
|
argv[1] = "--login";
|
||||||
// argv[2] = "/boot/loginscript";
|
shell_process = start_process(2, argv, &theconsole);
|
||||||
shell_process = start_process(1, argv, &theconsole);
|
|
||||||
|
|
||||||
wait_for_thread(shell_process, &retcode);
|
wait_for_thread(shell_process, &retcode);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user