From: Karel Zak Date: Wed, 17 Apr 2013 15:23:26 +0000 (+0200) Subject: sulogin: fix compiler warnings X-Git-Tag: v2.23~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a303e047bb0a464914b962c4cabb5c9b241ed418;p=thirdparty%2Futil-linux.git sulogin: fix compiler warnings Signed-off-by: Karel Zak --- diff --git a/login-utils/sulogin-consoles.c b/login-utils/sulogin-consoles.c index 305d1e7dcc..d0f0eab2be 100644 --- a/login-utils/sulogin-consoles.c +++ b/login-utils/sulogin-consoles.c @@ -507,11 +507,11 @@ done: return rc; } +#ifdef TIOCGDEV static int detect_consoles_from_tiocgdev(struct list_head *consoles, int fallback, const char *device) { -#ifdef TIOCGDEV unsigned int devnum; char *name; int rc = 1, fd = -1; @@ -566,9 +566,8 @@ done: close(fd); DBG(dbgprint("[tiocgdev rc=%d]", rc)); return rc; -#endif - return 2; } +#endif /* TIOCGDEV */ #endif /* __linux__ */ /* @@ -704,12 +703,13 @@ console: * Detection of the device used for Linux system console using * the ioctl TIOCGDEV if available (e.g. official 2.6.38). */ +#ifdef TIOCGDEV rc = detect_consoles_from_tiocgdev(consoles, fallback, device); if (rc == 0) return reconnect; /* success */ if (rc < 0) return rc; /* fatal error */ - +#endif if (!list_empty(consoles)) { DBG(dbgprint("detection success [rc=%d]", reconnect)); return reconnect;