bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] sulogin: Use fallback method on the Hurd for detecting consoles


From: James Clarke
Subject: [PATCH] sulogin: Use fallback method on the Hurd for detecting consoles
Date: Sat, 10 Oct 2015 00:29:47 +0100

Signed-off-by: James Clarke <jrtc27@jrtc27.com>
---
 login-utils/sulogin-consoles.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c
index 39d24d2..1b05b38 100644
--- a/login-utils/sulogin-consoles.c
+++ b/login-utils/sulogin-consoles.c
@@ -612,6 +612,14 @@ int detect_consoles(const char *device, int fallback, 
struct list_head *consoles
 #ifdef TIOCGDEV
                unsigned int devnum;
 #endif
+#ifdef __GNU__
+               /*
+                * The Hurd always gives st_rdev as 0, which causes this
+                * method to select the first terminal it finds.
+                */
+               close(fd);
+               goto fallback;
+#endif
                DBG(dbgprint("trying device/fallback file descriptor"));
 
                if (fstat(fd, &st) < 0) {
-- 
2.5.3




reply via email to

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