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

2015-10-16 Thread Karel Zak
On Sat, Oct 10, 2015 at 12:29:47AM +0100, James Clarke wrote:
>  login-utils/sulogin-consoles.c | 8 
>  1 file changed, 8 insertions(+)

 Applied, thanks.

-- 
 Karel Zak  
 http://karelzak.blogspot.com



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

2015-10-09 Thread James Clarke
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 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, ) < 0) {
-- 
2.5.3