From: James Clarke Date: Fri, 9 Oct 2015 23:29:47 +0000 (+0100) Subject: sulogin: Use fallback method on the Hurd for detecting consoles X-Git-Tag: v2.28-rc1~305 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99eadc9e3f9a6dc012072c97b9d0845ba13974f8;p=thirdparty%2Futil-linux.git sulogin: Use fallback method on the Hurd for detecting consoles Signed-off-by: James Clarke --- 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"));