]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: Use fallback method on the Hurd for detecting consoles
authorJames Clarke <jrtc27@jrtc27.com>
Fri, 9 Oct 2015 23:29:47 +0000 (00:29 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 16 Oct 2015 07:52:16 +0000 (09:52 +0200)
Signed-off-by: James Clarke <jrtc27@jrtc27.com>
login-utils/sulogin-consoles.c

index 39d24d293f987788aa6b52a8eb5df195d257e355..1b05b38005418079c4db66c240115ad9463ae40f 100644 (file)
@@ -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"));