From 7f971e3b54a4cdfe2d0ac1792ecec33d935425d9 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 27 May 1996 17:15:34 +0000 Subject: (launch_single_user): Open TERM RDWR. Use openport to get FD from TERM. --- init/init.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'init') diff --git a/init/init.c b/init/init.c index 9c845377..0fc64c40 100644 --- a/init/init.c +++ b/init/init.c @@ -630,7 +630,7 @@ launch_single_user () and we're done. Otherwise, start /hurd/term on something inside /tmp and use that. */ termname = _PATH_CONSOLE; - term = file_name_lookup (termname, O_READ, 0); + term = file_name_lookup (termname, O_RDWR, 0); if (term != MACH_PORT_NULL) { err = io_stat (term, &st); @@ -682,7 +682,7 @@ launch_single_user () mach_port_deallocate (mach_task_self (), term); /* Now repeat the open. */ - term = file_name_lookup (termname, O_READ, 0); + term = file_name_lookup (termname, O_RDWR, 0); if (term == MACH_PORT_NULL) { perror (termname); @@ -709,9 +709,9 @@ launch_single_user () Otherwise, open fd's 0, 1, and 2. */ if (term != MACH_PORT_NULL) { - errno = 0; - fd = open (termname, O_RDWR); - assert_perror (perror); + fd = openport (term, O_RDWR); + if (fd < 0) + assert_perror (errno); dup2 (fd, 0); close (fd); -- cgit v1.2.3