mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 05:37:54 +00:00
libc: use timegm
instead of mktime
By using `mktime()`, which assumes local time, we render the `TZ` environment variable ineffective. Instead, `timegm()` should be used to set the real-time clock to UTC. genodelabs/genode#5074
This commit is contained in:
parent
b80fd10a70
commit
c1bc9f8557
@ -55,7 +55,7 @@ struct Libc::Rtc : Vfs::Watch_response_handler
|
||||
struct tm tm { };
|
||||
if (strptime(buf, "%Y-%m-%d %H:%M:%S", &tm)
|
||||
|| strptime(buf, "%Y-%m-%d %H:%M", &tm)) {
|
||||
_rtc_value = mktime(&tm);
|
||||
_rtc_value = timegm(&tm);
|
||||
if (_rtc_value == (time_t)-1)
|
||||
_rtc_value = 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user