bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/2] console-run: Create and settrans /dev/console when not alrea


From: Ludovic Courtès
Subject: [PATCH 2/2] console-run: Create and settrans /dev/console when not already done.
Date: Mon, 5 Mar 2012 23:36:53 +0100

This patch makes sure /libexec/console-run creates and installs
/dev/console on the first run without considering it a failure if it
didn't exist already.

* daemons/console-run.c (TERMINAL_FIRST_TRY): Change node to
  `/dev/console'.
  (TERMINAL_SECOND_TRY): Change node to `/tmp/console'.
  (open_console): Clear FALLBACK when TRY == 1 and the
  `file_set_translator' call suceeded.
---
 daemons/console-run.c |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/daemons/console-run.c b/daemons/console-run.c
index 3ab2629..d120d17 100644
--- a/daemons/console-run.c
+++ b/daemons/console-run.c
@@ -81,8 +81,8 @@ main (int argc, char **argv)
 static int
 open_console (char **namep)
 {
-#define TERMINAL_FIRST_TRY "/hurd/term\0/tmp/console\0device\0console"
-#define TERMINAL_SECOND_TRY "/hurd/term\0/tmp\0device\0console"
+#define TERMINAL_FIRST_TRY "/hurd/term\0/dev/console\0device\0console"
+#define TERMINAL_SECOND_TRY "/hurd/term\0/tmp/console\0device\0console"
   mach_port_t term, proc;
   static char *termname;
   struct stat st;
@@ -183,7 +183,13 @@ open_console (char **namep)
 
          if (term != MACH_PORT_NULL)
            {
-             error (0, 0, "Using temporary console %s", termname);
+             if (try == 1)
+               /* We created /dev/console, started, and installed the
+                  translator on it, so it really isn't a fallback
+                  console.  */
+               fallback = 0;
+             else
+               error (0, 0, "Using temporary console %s", termname);
              break;
            }
        }
-- 
1.7.6




reply via email to

[Prev in Thread] Current Thread [Next in Thread]