]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib/consoles: try another methods before go to fallback
authorKarel Zak <kzak@redhat.com>
Fri, 9 Nov 2012 11:52:33 +0000 (12:52 +0100)
committerKarel Zak <kzak@redhat.com>
Fri, 9 Nov 2012 11:52:33 +0000 (12:52 +0100)
The current code goes immediately to the fallback section if any
detection method fails. It seems better to try another methods before
the fallback solution.

Signed-off-by: Karel Zak <kzak@redhat.com>
lib/consoles.c

index 11b7d738d4612715fc1c8bc725924fd51e878159..a0faa69209955484331323c81ad22fa9eb98365f 100644 (file)
@@ -598,8 +598,6 @@ console:
                return reconnect;       /* success */
        if (rc < 0)
                return rc;              /* fatal error */
-       if (rc == 1)
-               goto fallback;          /* detection error */
 
        /*
         * Detection of devices used for Linux system console using
@@ -610,8 +608,6 @@ console:
                return reconnect;       /* success */
        if (rc < 0)
                return rc;              /* fatal error */
-       if (rc == 1)
-               goto fallback;          /* detection error */
 
        /*
         * Detection of devices used for Linux system console using
@@ -622,8 +618,6 @@ console:
                return reconnect;       /* success */
        if (rc < 0)
                return rc;              /* fatal error */
-       if (rc == 1)
-               goto fallback;          /* detection error */
 
        /*
         * Detection of the device used for Linux system console using
@@ -634,11 +628,11 @@ console:
                return reconnect;       /* success */
        if (rc < 0)
                return rc;              /* fatal error */
-       if (rc == 1)
-               goto fallback;          /* detection error */
 
-       DBG(dbgprint("detection success [rc=%d]", reconnect));
-       return reconnect;
+       if (*consoles) {
+               DBG(dbgprint("detection success [rc=%d]", reconnect));
+               return reconnect;
+       }
 
 #endif /* __linux __ */