summaryrefslogtreecommitdiff
path: root/Cargo.toml
diff options
context:
space:
mode:
authorBen Bridle <bridle.benjamin@gmail.com>2024-10-31 09:41:40 +1300
committerBen Bridle <bridle.benjamin@gmail.com>2024-10-31 09:46:06 +1300
commit31b697819cdee2c28fb1839589a389e39156e414 (patch)
treed1e0834e6c707cf4ad96f69f9a6fbf59f00d89b5 /Cargo.toml
parent02deef3511e8613a5d737d5586f1efd9fd01637c (diff)
downloadbedrock-pc-31b697819cdee2c28fb1839589a389e39156e414.zip
Fix issue with clock device returning UTC time instead of local time
The project previously used the `time` crate for getting the current time in the local timezone. It was discovered that the time crate would fail to return the local time when the program used multiple threads, because of concerns that the other threads could modify timezone-related environment variables while the timezone was being read from the system and create a soundness issue. A second program thread was introduced recently by commit 1a830a3 to provide non-blocking reads of standard input for the local stream device, and so the time returned by the clock device was falling back to UTC. To fix this, the `time` crate has been replaced by the `chrono` crate which does not suffer from this restriction, and in any case seems to be the more popular of the two anyway.
Diffstat (limited to 'Cargo.toml')
-rw-r--r--Cargo.toml2
1 files changed, 1 insertions, 1 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 40230b6..d69da8b 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -11,7 +11,7 @@ bedrock-core = { git = "git://benbridle.com/bedrock_core", tag = "v5.0.0" }
phosphor = { git = "git://benbridle.com/phosphor", tag = "v3.1.0" }
geometry = { git = "git://benbridle.com/geometry", tag = "v1.0.0" }
-time = { version = "0.3.30", features = [ "local-offset" ] }
+chrono = { version = "0.4.38" }
xflags = "0.4.0-pre.1"
[target.'cfg(target_os = "windows")'.dependencies]