-static int console_setup(bool do_reset) {
- int tty_fd = -1, null_fd = -1, r = 0;
-
- /* If we are init, we connect stdout/stderr to /dev/console
- * and stdin to /dev/null and make sure we don't have a
- * controlling tty. */
-
- release_terminal();
-
- if ((tty_fd = open_terminal("/dev/console", O_WRONLY)) < 0) {
- log_error("Failed to open /dev/console: %s", strerror(-tty_fd));
- r = -tty_fd;
- goto finish;
- }