diff options
author | Andrzej Bialecki <abial@FreeBSD.org> | 1998-11-15 23:26:32 +0000 |
---|---|---|
committer | Andrzej Bialecki <abial@FreeBSD.org> | 1998-11-15 23:26:32 +0000 |
commit | 10639dcf7758d994d6541f338e04df37fa461d79 (patch) | |
tree | c78287b9d6646a748890a06e67aa942f838b5aa8 /release/picobsd/tinyware/oinit/oinit.c | |
parent | b735c71405386526faf076f9b61dab34f4c979f3 (diff) | |
download | src-10639dcf7758d994d6541f338e04df37fa461d79.tar.gz src-10639dcf7758d994d6541f338e04df37fa461d79.zip |
Use console instead of ttyv0 - it didn't work with serial console...
Notes
Notes:
svn path=/head/; revision=41191
Diffstat (limited to 'release/picobsd/tinyware/oinit/oinit.c')
-rw-r--r-- | release/picobsd/tinyware/oinit/oinit.c | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/release/picobsd/tinyware/oinit/oinit.c b/release/picobsd/tinyware/oinit/oinit.c index 01f8b9741e5b..1bf70bdaf343 100644 --- a/release/picobsd/tinyware/oinit/oinit.c +++ b/release/picobsd/tinyware/oinit/oinit.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: oinit.c,v 1.1.1.1 1998/08/27 17:38:45 abial Exp $ + * $Id: oinit.c,v 1.2 1998/10/15 21:40:07 abial Exp $ */ /* @@ -83,7 +83,7 @@ extern char **environ; /* Struct for holding session state */ struct sess { - char tty[11]; /* vty device path */ + char tty[16]; /* vty device path */ pid_t pid; /* pid of process running on it */ int (*func)(int argc, char **argv); /* internal function to run on it (after forking) */ @@ -646,6 +646,16 @@ runcom() void runcom(char *fname) { + int fd; + + close(0); + close(1); + close(2); + fd=open(_PATH_CONSOLE,O_RDWR); + dup2(fd,0); + dup2(fd,1); + dup2(fd,2); + if(fd>2) close(fd); sourcer(fname); } #endif @@ -902,9 +912,13 @@ main(int argc, char **argv) mount("devfs","/dev",MNT_NOEXEC|MNT_RDONLY,0); /* Fill in the sess structures. */ - /* XXX Really, should be filled basing on config file. */ + /* XXX Really, should be filled based upon config file. */ for(i=0;i<MAX_CONS;i++) { - sprintf(ttys[i].tty,"/dev/ttyv%c",vty[i]); + if(i==0) { + sprintf(ttys[i].tty,"/dev/console"); + } else { + sprintf(ttys[i].tty,"/dev/ttyv%c",vty[i]); + } ttys[i].pid=0; ttys[i].func=shell; } |