Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: runtime/bin/main.cc

Issue 1410293006: Use ExitProcess on Windows. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add noreturn to Platform::Exit" Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | runtime/bin/platform.h » ('j') | runtime/platform/globals.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/main.cc
diff --git a/runtime/bin/main.cc b/runtime/bin/main.cc
index 680dea3926f8702c7d36544b23117ba11e6e59c4..9d49ffb5204ff85db16df7b02d8d912476332a88 100644
--- a/runtime/bin/main.cc
+++ b/runtime/bin/main.cc
@@ -142,7 +142,7 @@ static void ErrorExit(int exit_code, const char* format, ...) {
DebuggerConnectionHandler::StopHandler();
EventHandler::Stop();
}
- exit(exit_code);
+ Platform::Exit(exit_code);
}
@@ -1116,12 +1116,12 @@ static void* LoadLibrarySymbol(const char* libname, const char* symname) {
void* library = Extensions::LoadExtensionLibrary(libname);
if (library == NULL) {
Log::PrintErr("Error: Failed to load library '%s'\n", libname);
- exit(kErrorExitCode);
+ Platform::Exit(kErrorExitCode);
}
void* symbol = Extensions::ResolveSymbol(library, symname);
if (symbol == NULL) {
Log::PrintErr("Error: Failed to load symbol '%s'\n", symname);
- exit(kErrorExitCode);
+ Platform::Exit(kErrorExitCode);
}
return symbol;
}
@@ -1202,7 +1202,7 @@ bool RunMainIsolate(const char* script_name,
DebuggerConnectionHandler::StopHandler();
EventHandler::Stop();
}
- exit((exit_code != 0) ? exit_code : kErrorExitCode);
+ Platform::Exit((exit_code != 0) ? exit_code : kErrorExitCode);
}
delete [] isolate_name;
@@ -1384,18 +1384,18 @@ void main(int argc, char** argv) {
&verbose_debug_seen) < 0) {
if (has_help_option) {
PrintUsage();
- exit(0);
+ Platform::Exit(0);
} else if (has_version_option) {
PrintVersion();
- exit(0);
+ Platform::Exit(0);
} else if (print_flags_seen) {
// Will set the VM flags, print them out and then we exit as no
// script was specified on the command line.
Dart_SetVMFlags(vm_options.count(), vm_options.arguments());
- exit(0);
+ Platform::Exit(0);
} else {
PrintUsage();
- exit(kErrorExitCode);
+ Platform::Exit(kErrorExitCode);
}
}
@@ -1405,7 +1405,7 @@ void main(int argc, char** argv) {
OSError err;
fprintf(stderr, "Error determining current directory: %s\n", err.message());
fflush(stderr);
- exit(kErrorExitCode);
+ Platform::Exit(kErrorExitCode);
}
if (generate_script_snapshot) {
@@ -1455,7 +1455,7 @@ void main(int argc, char** argv) {
fprintf(stderr, "VM initialization failed: %s\n", error);
fflush(stderr);
free(error);
- exit(kErrorExitCode);
+ Platform::Exit(kErrorExitCode);
}
Dart_RegisterIsolateServiceRequestCallback(
@@ -1497,7 +1497,7 @@ void main(int argc, char** argv) {
delete environment;
}
- exit(Process::GlobalExitCode());
+ Platform::Exit(Process::GlobalExitCode());
}
} // namespace bin
« no previous file with comments | « no previous file | runtime/bin/platform.h » ('j') | runtime/platform/globals.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698