X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=tools%2Flguest%2Flguest.c;h=11c8d9bc762ef0c4bde99dec4292e84ff00d3477;hb=8ff77206aa36949afab46be43a3d14af75a4e270;hp=d9836c5eb694c48c30a6d07827ee36ed086b4309;hpb=9503427e916aea7ec2cc429504f82d7200ab4bcd;p=karo-tx-linux.git diff --git a/tools/lguest/lguest.c b/tools/lguest/lguest.c index d9836c5eb694..11c8d9bc762e 100644 --- a/tools/lguest/lguest.c +++ b/tools/lguest/lguest.c @@ -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)