Skip to content

Commit c49c504

Browse files
committed
fixup! src: consolidate exit codes in the code base
1 parent fa76b0d commit c49c504

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

src/api/hooks.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ Maybe<bool> EmitProcessBeforeExit(Environment* env) {
5353
Nothing<bool>() : Just(true);
5454
}
5555

56-
ExitCode EmitExitInternal(Environment* env) {
56+
static ExitCode EmitExitInternal(Environment* env) {
5757
return EmitProcessExitInternal(env).FromMaybe(ExitCode::kGenericUserError);
5858
}
5959

src/env.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1521,8 +1521,9 @@ void Environment::Exit(ExitCode exit_code) {
15211521
uv_os_getpid(), thread_id());
15221522
}
15231523

1524-
fprintf(
1525-
stderr, "WARNING: Exited the environment with code %d\n", exit_code);
1524+
fprintf(stderr,
1525+
"WARNING: Exited the environment with code %d\n",
1526+
static_cast<int>(exit_code));
15261527
PrintStackTrace(isolate(),
15271528
StackTrace::CurrentStackTrace(
15281529
isolate(), stack_trace_limit(), StackTrace::kDetailed));

src/node.cc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,10 @@ void ResetStdio() {
626626
#endif // __POSIX__
627627
}
628628

629-
ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
630-
std::vector<std::string>* exec_args,
631-
std::vector<std::string>* errors,
632-
OptionEnvvarSettings settings) {
629+
static ExitCode ProcessGlobalArgsInternal(std::vector<std::string>* args,
630+
std::vector<std::string>* exec_args,
631+
std::vector<std::string>* errors,
632+
OptionEnvvarSettings settings) {
633633
// Parse a few arguments which are specific to Node.
634634
std::vector<std::string> v8_args;
635635

@@ -717,7 +717,7 @@ static std::atomic_bool init_called{false};
717717

718718
// TODO(addaleax): Turn this into a wrapper around InitializeOncePerProcess()
719719
// (with the corresponding additional flags set), then eventually remove this.
720-
ExitCode InitializeNodeWithArgsInternal(
720+
static ExitCode InitializeNodeWithArgsInternal(
721721
std::vector<std::string>* argv,
722722
std::vector<std::string>* exec_argv,
723723
std::vector<std::string>* errors,
@@ -839,10 +839,10 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
839839
InitializeNodeWithArgsInternal(argv, exec_argv, errors, flags));
840840
}
841841

842-
std::unique_ptr<InitializationResultImpl> InitializeOncePerProcessInternal(
843-
const std::vector<std::string>& args,
844-
ProcessInitializationFlags::Flags flags =
845-
ProcessInitializationFlags::kNoFlags) {
842+
static std::unique_ptr<InitializationResultImpl>
843+
InitializeOncePerProcessInternal(const std::vector<std::string>& args,
844+
ProcessInitializationFlags::Flags flags =
845+
ProcessInitializationFlags::kNoFlags) {
846846
auto result = std::make_unique<InitializationResultImpl>();
847847
result->args_ = args;
848848

@@ -1165,7 +1165,7 @@ ExitCode LoadSnapshotDataAndRun(const SnapshotData** snapshot_data_ptr,
11651165
return exit_code;
11661166
}
11671167

1168-
ExitCode StartInternal(int argc, char** argv) {
1168+
static ExitCode StartInternal(int argc, char** argv) {
11691169
CHECK_GT(argc, 0);
11701170

11711171
// Hack around with the argv pointer. Used for process.title = "blah".

0 commit comments

Comments
 (0)