X-Git-Url: https://git.reactos.org/?p=reactos.git;a=blobdiff_plain;f=reactos%2Fboot%2Ffreeldr%2Ffreeldr%2Ffreeldr.c;h=01af41e22195efe857a4c853b03597007bbdf178;hp=6d069b635737922b27f9207d050fd522c572035a;hb=16ce2a0acf29b62927ee8d0cddbbc17f12832dcb;hpb=d03fcd8a09f8aeea41395a2b64cd89d7aacbdbaa diff --git a/reactos/boot/freeldr/freeldr/freeldr.c b/reactos/boot/freeldr/freeldr/freeldr.c index 6d069b63573..01af41e2219 100644 --- a/reactos/boot/freeldr/freeldr/freeldr.c +++ b/reactos/boot/freeldr/freeldr/freeldr.c @@ -40,13 +40,13 @@ VOID BootMain(LPSTR CmdLine) if (!UiInitialize(FALSE)) { UiMessageBoxCritical("Unable to initialize UI.\n"); - return; + goto quit; } if (!MmInitializeMemoryManager()) { UiMessageBoxCritical("Unable to initialize memory manager"); - return; + goto quit; } #ifdef _M_IX86 @@ -54,6 +54,11 @@ VOID BootMain(LPSTR CmdLine) HalpInitBusHandler(); #endif RunLoader(); + +quit: + /* If we reach this point, something went wrong before, therefore reboot */ + DiskStopFloppyMotor(); + Reboot(); } // We need to emulate these, because the original ones don't work in freeldr