mirror of
https://github.com/troglobit/finit.git
synced 2026-10-15 10:29:35 +00:00
sulogin: ensure Ctrl-D returns OK(0) also for pwd login prompt
sulogin should return OK (exit code 0) when the user presses Ctrl-D, regardless of the prompt shown. Otherwise Finit may look for another sulogin to run straight after this one. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
33deada6f0
commit
2531102623
1 file changed
+3
-1
+3
-1
@@ -177,8 +177,10 @@ int main(void)
|
||||
ch = getchar();
|
||||
if (ch == '\n' || ch == '\r')
|
||||
break;
|
||||
if (ch == 4 || ch == EOF) /* Ctrl-D */
|
||||
if (ch == 4 || ch == EOF) { /* Ctrl-D */
|
||||
rc = 0;
|
||||
goto exit;
|
||||
}
|
||||
|
||||
pwd[i++] = ch;
|
||||
} while (i + 1 < sizeof(pwd));
|
||||
|
||||
Reference in new issue
Block a user