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
This commit is contained in:
Stephan Aßmus
2010-05-06 15:11:25 +00:00
parent 13fa4c845a
commit bf912ae3b9
+8 -5
View File
@@ -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: