diff options
author | Miles Bader <miles@gnu.org> | 1996-05-27 17:15:34 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1996-05-27 17:15:34 +0000 |
commit | 7f971e3b54a4cdfe2d0ac1792ecec33d935425d9 (patch) | |
tree | d3a24af8a417ad6c57dad1ac5260bafd745cacce /init/init.c | |
parent | 0488da0dd5477b22c3faa6f61e8ff5c422705486 (diff) |
(launch_single_user): Open TERM RDWR. Use openport to get FD from TERM.
Diffstat (limited to 'init/init.c')
-rw-r--r-- | init/init.c | 10 |
1 files changed, 5 insertions, 5 deletions
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); |