mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
tools/lguest: Don't bork the terminal in case of wrong args
Running lguest without arguments or with a wrong argument name borks the terminal, because the cleanup handler is set up too late in the initialization process. Signed-off-by: Daniel Baluta <[email protected]> Signed-off-by: Rusty Russell <[email protected]> Cc: Andy Lutomirski <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Brian Gerst <[email protected]> Cc: Denys Vlasenko <[email protected]> Cc: H. Peter Anvin <[email protected]> Cc: Josh Poimboeuf <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Signed-off-by: Ingo Molnar <[email protected]>
This commit is contained in:
parent
cc2187a6e0
commit
db91e2370e
1 changed files with 3 additions and 3 deletions
|
|
@ -3266,6 +3266,9 @@ int main(int argc, char *argv[])
|
|||
}
|
||||
}
|
||||
|
||||
/* If we exit via err(), this kills all the threads, restores tty. */
|
||||
atexit(cleanup_devices);
|
||||
|
||||
/* We always have a console device, and it's always device 1. */
|
||||
setup_console();
|
||||
|
||||
|
|
@ -3369,9 +3372,6 @@ int main(int argc, char *argv[])
|
|||
/* Ensure that we terminate if a device-servicing child dies. */
|
||||
signal(SIGCHLD, kill_launcher);
|
||||
|
||||
/* If we exit via err(), this kills all the threads, restores tty. */
|
||||
atexit(cleanup_devices);
|
||||
|
||||
/* If requested, chroot to a directory */
|
||||
if (chroot_path) {
|
||||
if (chroot(chroot_path) != 0)
|
||||
|
|
|
|||
Loading…
Reference in a new issue