wait for tty[23], seems also fix hard drives presense on el-smp

This commit is contained in:
Anton V. Boyarshinov 2010-11-18 14:56:54 +03:00
parent eb77419a50
commit fccb211884
2 changed files with 14 additions and 2 deletions

8
log.c
View File

@ -67,8 +67,14 @@ void log_perror(char *msg)
void open_log(void)
{
int i;
int timeout = 60;
if (!IS_TESTING) {
logfile = fopen("/dev/tty3", "w");
for(i=0; i < timeout; i++ ) {
logfile = fopen("/dev/tty3", "w");
if(logfile > -1) break;
sleep(1);
}
if (!logfile)
logfile = fopen("/tmp/install.log", "a");
}

View File

@ -110,12 +110,18 @@ static void spawn_shell(void)
{
#ifdef SPAWN_SHELL
int fd;
int i;
int timeout=60;
char * shell_name[] = { "/bin/sh", NULL };
log_message("spawning a shell");
if (!IS_TESTING) {
fd = open("/dev/tty2", O_RDWR);
for(i=0; i < timeout; i++ ) {
fd = open("/dev/tty2", O_RDWR);
if(fd > -1) break;
sleep(1);
}
if (fd == -1) {
log_message("cannot open /dev/tty2 -- no shell will be provided");
return;