From 99eadc9e3f9a6dc012072c97b9d0845ba13974f8 Mon Sep 17 00:00:00 2001 From: James Clarke Date: Sat, 10 Oct 2015 00:29:47 +0100 Subject: [PATCH] sulogin: Use fallback method on the Hurd for detecting consoles Signed-off-by: James Clarke --- 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 39d24d293f..1b05b38005 100644 --- a/login-utils/sulogin-consoles.c +++ b/login-utils/sulogin-consoles.c @@ -611,6 +611,14 @@ int detect_consoles(const char *device, int fallback, struct list_head *consoles struct stat st; #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")); -- 2.47.3