-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Micha Hanselmann
committed
Jul 29, 2019
1 parent
4838bd7
commit ac60f36
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
patches/node/fix_set_uptime_offset_in_correct_init_method.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
|