login: Return 2 when 'disconnect' is provided as a username
This commit is contained in:
parent
62368bbf44
commit
2b428defd5
|
@ -201,10 +201,11 @@ int main(int argc, char * argv[]) {
|
|||
};
|
||||
execvp(args[0], args);
|
||||
} else {
|
||||
int result;
|
||||
int result, status;
|
||||
do {
|
||||
result = waitpid(f, NULL, 0);
|
||||
result = waitpid(f, &status, 0);
|
||||
} while (result < 0);
|
||||
if (WEXITSTATUS(status) == 2) break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -99,6 +99,10 @@ int main(int argc, char ** argv) {
|
|||
system("reboot");
|
||||
}
|
||||
|
||||
if (!strcmp(username, "disconnect")) {
|
||||
return 2;
|
||||
}
|
||||
|
||||
fprintf(stdout, "password: ");
|
||||
fflush(stdout);
|
||||
|
||||
|
|
Loading…
Reference in New Issue