|
@@ -0,0 +1,29 @@
|
|
|
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
+From: Micha Hanselmann <[email protected]>
|
|
|
+Date: Thu, 1 Aug 2019 09:59:48 -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 c0a8bdd28a403b399f2766e40b2fe90e76fca849..193a4b3e91a744b6934658f531b2f46698ad8323 100644
|
|
|
+--- a/src/node.cc
|
|
|
++++ b/src/node.cc
|
|
|
+@@ -624,6 +624,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();
|
|
|
+
|
|
|
+@@ -810,7 +813,6 @@ void Init(int* argc,
|
|
|
+ InitializationResult InitializeOncePerProcess(int argc, char** argv) {
|
|
|
+ atexit([] () { uv_tty_reset_mode(); });
|
|
|
+ PlatformInit();
|
|
|
+- per_process::node_start_time = uv_hrtime();
|
|
|
+
|
|
|
+ CHECK_GT(argc, 0);
|
|
|
+
|