forked from Imagelibrary/rtems
_Timecounter_Time_uptime: Change from int32_t to time_t
Using int32_t results in an overflow in Y2038. This was detected by Covered as CIDs 1512549 and 1512552. Closes #5204
This commit is contained in:
committed by
Gedare Bloom
parent
91237f06f9
commit
ec8fa5fc6d
@@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
extern volatile time_t _Timecounter_Time_second;
|
extern volatile time_t _Timecounter_Time_second;
|
||||||
extern volatile int32_t _Timecounter_Time_uptime;
|
extern volatile time_t _Timecounter_Time_uptime;
|
||||||
extern struct bintime _Timecounter_Boottimebin;
|
extern struct bintime _Timecounter_Boottimebin;
|
||||||
|
|
||||||
void _Timecounter_Binuptime(struct bintime *);
|
void _Timecounter_Binuptime(struct bintime *);
|
||||||
|
|||||||
@@ -256,7 +256,7 @@ extern volatile time_t _Timecounter_Time_second;
|
|||||||
* For compatibility with the FreeBSD network stack the initial value is one
|
* For compatibility with the FreeBSD network stack the initial value is one
|
||||||
* second.
|
* second.
|
||||||
*/
|
*/
|
||||||
extern volatile int32_t _Timecounter_Time_uptime;
|
extern volatile time_t _Timecounter_Time_uptime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The current timecounter.
|
* @brief The current timecounter.
|
||||||
|
|||||||
@@ -282,11 +282,10 @@ struct timecounter *timecounter = &dummy_timecounter;
|
|||||||
|
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
volatile time_t time_second = 1;
|
volatile time_t time_second = 1;
|
||||||
volatile time_t time_uptime = 1;
|
|
||||||
#else /* __rtems__ */
|
#else /* __rtems__ */
|
||||||
volatile time_t time_second = TOD_SECONDS_1970_THROUGH_1988;
|
volatile time_t time_second = TOD_SECONDS_1970_THROUGH_1988;
|
||||||
volatile int32_t time_uptime = 1;
|
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
|
volatile time_t time_uptime = 1;
|
||||||
|
|
||||||
#ifndef __rtems__
|
#ifndef __rtems__
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user