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" #include "BootPromptWindow.h"
static int sExitValue;
int int
main(int, char **) main(int, char **)
{ {
BootPromptApp app; BootPromptApp app;
app.Run(); app.Run();
return 0; return sExitValue;
} }
@@ -40,12 +43,12 @@ BootPromptApp::MessageReceived(BMessage* message)
{ {
switch (message->what) { switch (message->what) {
case MSG_BOOT_DESKTOP: case MSG_BOOT_DESKTOP:
// TODO: Exit with some value that the Bootscript can deal with. sExitValue = 1;
exit(1); PostMessage(B_QUIT_REQUESTED);
break; break;
case MSG_RUN_INSTALLER: case MSG_RUN_INSTALLER:
// TODO: Exit with some value that the Bootscript can deal with. sExitValue = 0;
exit(0); PostMessage(B_QUIT_REQUESTED);
break; break;
default: default: