summaryrefslogtreecommitdiffstats
path: root/release/picobsd
diff options
context:
space:
mode:
authorabial <abial@FreeBSD.org>1998-11-15 23:26:32 +0000
committerabial <abial@FreeBSD.org>1998-11-15 23:26:32 +0000
commit219aa53ba942b6e48a0662667df638d45383146c (patch)
tree0bc56954eb6969f3dde6f09ed5c2ce1dbcdf4bc2 /release/picobsd
parent3c18aae061e62507b11baf1e0022cec1265eff15 (diff)
downloadFreeBSD-src-219aa53ba942b6e48a0662667df638d45383146c.zip
FreeBSD-src-219aa53ba942b6e48a0662667df638d45383146c.tar.gz
Use console instead of ttyv0 - it didn't work with serial console...
Diffstat (limited to 'release/picobsd')
-rw-r--r--release/picobsd/tinyware/oinit/oinit.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/release/picobsd/tinyware/oinit/oinit.c b/release/picobsd/tinyware/oinit/oinit.c
index 01f8b97..1bf70bd 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;
}
OpenPOWER on IntegriCloud