From 10639dcf7758d994d6541f338e04df37fa461d79 Mon Sep 17 00:00:00 2001 From: Andrzej Bialecki Date: Sun, 15 Nov 1998 23:26:32 +0000 Subject: [PATCH] Use console instead of ttyv0 - it didn't work with serial console... --- release/picobsd/tinyware/oinit/oinit.c | 22 ++++++++++++++++++---- 1 file 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