mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 00:19:22 +02:00
Changed the value of TimeType_Default to TimeType_UserSystemClock. When timeGetCurrentTime fails where __nx_time_type isn't TimeType_Default, call it again with TimeType_Default.
This commit is contained in:
parent
16bbf3411e
commit
0b1b7039ca
@ -14,7 +14,7 @@ typedef enum {
|
||||
TimeType_UserSystemClock,
|
||||
TimeType_NetworkSystemClock,
|
||||
TimeType_LocalSystemClock,
|
||||
TimeType_Default = TimeType_NetworkSystemClock,
|
||||
TimeType_Default = TimeType_UserSystemClock,
|
||||
} TimeType;
|
||||
|
||||
Result timeInitialize(void);
|
||||
|
@ -21,7 +21,7 @@ extern const u8 __tdata_lma[];
|
||||
extern const u8 __tdata_lma_end[];
|
||||
extern u8 __tls_start[];
|
||||
|
||||
/// TimeType passed to timeGetCurrentTime() by __libnx_gtod().
|
||||
/// TimeType passed to timeGetCurrentTime() during time initialization. If that fails and __nx_time_type isn't TimeType_Default, timeGetCurrentTime() will be called again with TimeType_Default.
|
||||
__attribute__((weak)) TimeType __nx_time_type = TimeType_Default;
|
||||
|
||||
static struct _reent* __libnx_get_reent(void) {
|
||||
@ -38,6 +38,7 @@ static u64 __bootticks;
|
||||
// setup boot time variables
|
||||
void __libnx_init_time(void) {
|
||||
Result rc = timeGetCurrentTime(__nx_time_type, &__boottime);
|
||||
if (R_FAILED(rc) && __nx_time_type != TimeType_Default) rc = timeGetCurrentTime(TimeType_Default, &__boottime);
|
||||
if (R_FAILED(rc)) {
|
||||
__boottime = UINT64_MAX;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user