This commit is contained in:
Micha Hanselmann 2019-07-30 11:08:27 -07:00 коммит произвёл John Kleinschmidt
Родитель 38c918ed5c
Коммит 6e367dab9a
3 изменённых файлов: 30 добавлений и 1 удалений

Просмотреть файл

@ -40,3 +40,4 @@ fix_extern_the_nativemoduleenv_and_options_parser_for_debug_builds.patch
chore_read_nobrowserglobals_from_global_not_process.patch
chore_split_createenvironment_into_createenvironment_and.patch
chore_handle_default_configuration_not_being_set_in_the_electron_env.patch
fix_set_uptime_offset_in_correct_init_method.patch

Просмотреть файл

@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Micha Hanselmann <deermichel@github.com>
Date: Wed, 24 Jul 2019 11:44:25 -0700
Subject: fix: set uptime offset in correct init method
This patch can be removed after 'https://github.com/nodejs/node/pull/28849' landed here.
diff --git a/src/node.cc b/src/node.cc
index 707579c8254903f5c587fa42711eb5d0184b4112..64f46faa36a7b52d86b257adad6c54b93b894262 100644
--- a/src/node.cc
+++ b/src/node.cc
@@ -743,6 +743,9 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
// Make sure InitializeNodeWithArgs() is called only once.
CHECK(!init_called.exchange(true));
+ // Initialize node_start_time to get relative uptime.
+ per_process::node_start_time = uv_hrtime();
+
// Register built-in modules
binding::RegisterBuiltinModules();
@@ -929,7 +932,6 @@ void Init(int* argc,
InitializationResult InitializeOncePerProcess(int argc, char** argv) {
atexit(ResetStdio);
PlatformInit();
- per_process::node_start_time = uv_hrtime();
CHECK_GT(argc, 0);

Просмотреть файл

@ -79,7 +79,6 @@
"parallel/test-process-exec-argv",
"parallel/test-process-external-stdio-close",
"parallel/test-process-external-stdio-close-spawn",
"parallel/test-process-uptime",
"parallel/test-process-versions",
"parallel/test-readline-interface",
"parallel/test-inspector-esm",