forked from pool/util-linux
- Add patch sulogin-does-not-find-any-console.patch to enable sulogin to find suitable console device even if first is not usable (bnc#862078) - Avoid that hanging plymouth locks terminal lines that is add patch sulogin-fooled-on-tty-line-due-plymouth.patch and modify patch agetty-fooled-on-serial-line-due-plymouth.patch to remove any lock which had been left over. OBS-URL: https://build.opensuse.org/request/show/221269 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/util-linux?expand=0&rev=179
33 lines
951 B
Diff
33 lines
951 B
Diff
Enable sulogin to find a suitable console device even if the first line
|
|
in /proc/consoles does not have any major and minor number (bnc#862078)
|
|
|
|
---
|
|
sulogin-consoles.c | 6 ++++--
|
|
1 file changed, 4 insertions(+), 2 deletions(-)
|
|
|
|
--- login-utils/sulogin-consoles.c
|
|
+++ login-utils/sulogin-consoles.c 2014-02-07 15:47:14.246235487 +0000
|
|
@@ -319,7 +319,7 @@ static int detect_consoles_from_proc(str
|
|
char fbuf[16 + 1];
|
|
DIR *dir = NULL;
|
|
FILE *fc = NULL;
|
|
- int maj, min, rc = 1;
|
|
+ int maj, min, rc = 1, matches;
|
|
|
|
DBG(dbgprint("trying /proc"));
|
|
|
|
@@ -332,10 +332,12 @@ static int detect_consoles_from_proc(str
|
|
if (!dir)
|
|
goto done;
|
|
|
|
- while (fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min) == 3) {
|
|
+ while ((matches = fscanf(fc, "%*s %*s (%16[^)]) %d:%d", fbuf, &maj, &min)) >= 1) {
|
|
char *name;
|
|
dev_t comparedev;
|
|
|
|
+ if (matches != 3)
|
|
+ continue;
|
|
if (!strchr(fbuf, 'E'))
|
|
continue;
|
|
comparedev = makedev(maj, min);
|