Skip to content

Commit a34be21

Browse files
committed
lib: support setting process.env.TZ on windows
nodejs/node#38642
1 parent a5bbaa0 commit a34be21

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

patches/node/feat_add_flags_for_low-level_hooks_and_exceptions.patch

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,25 @@ index 905afd8c235b7b1a7b45823db486384935a2a52b..102847cd32d03addeb40c9539eafc92b
4747

4848
// Cache the original command line to be
4949
// used in diagnostic reports.
50-
@@ -871,6 +875,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
50+
@@ -894,7 +894,8 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
5151
if (exit_code != 0) return exit_code;
5252
}
5353
#endif
54+
-
5455
+ if (g_upstream_node_mode) {
5556
+ // NOTE(jeremy): indentation is intentionally wrong here, to ease rebasing.
56-
5757
const int exit_code = ProcessGlobalArgs(argv,
5858
exec_argv,
59-
@@ -915,6 +921,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
59+
errors,
60+
@@ -937,7 +938,7 @@ int InitializeNodeWithArgs(std::vector<std::string>* argv,
61+
return 9;
6062
}
6163
per_process::metadata.versions.InitializeIntlVersions();
62-
#endif
64+
-
6365
+ } // g_upstream_node_mode
64-
65-
NativeModuleEnv::InitializeCodeCache();
66-
66+
# ifndef __POSIX__
67+
std::string tz;
68+
if (credentials::SafeGetenv("TZ", &tz) && !tz.empty()) {
6769
diff --git a/src/node.h b/src/node.h
6870
index 38e0ef50f9b283b1d7ca8f54412d99b8cd38e524..34a16feaed229a59181e1b2e48b0e111d5b0b2a6 100644
6971
--- a/src/node.h

0 commit comments

Comments
 (0)