From bf912ae3b9f2c6048e29e76ecf7cb139643fdd1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 6 May 2010 15:11:25 +0000 Subject: [PATCH] Use another mechanism to return with the proper return code that does not involve using exit(), but instead quits the application cleanly. Tested with a test script and works as expected. Should fix #5923. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36652 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/readonlybootprompt/BootPrompt.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/apps/readonlybootprompt/BootPrompt.cpp b/src/apps/readonlybootprompt/BootPrompt.cpp index 354e55821d..190c444fe9 100644 --- a/src/apps/readonlybootprompt/BootPrompt.cpp +++ b/src/apps/readonlybootprompt/BootPrompt.cpp @@ -13,12 +13,15 @@ #include "BootPromptWindow.h" +static int sExitValue; + + int main(int, char **) { BootPromptApp app; app.Run(); - return 0; + return sExitValue; } @@ -40,12 +43,12 @@ BootPromptApp::MessageReceived(BMessage* message) { switch (message->what) { case MSG_BOOT_DESKTOP: - // TODO: Exit with some value that the Bootscript can deal with. - exit(1); + sExitValue = 1; + PostMessage(B_QUIT_REQUESTED); break; case MSG_RUN_INSTALLER: - // TODO: Exit with some value that the Bootscript can deal with. - exit(0); + sExitValue = 0; + PostMessage(B_QUIT_REQUESTED); break; default: