rtc: skip year-2038 overflow check in case time_t is 32bit only
PATCH 1/1 rtc: skip year-2038 overflow check in case time_t is 32bit only
Signed-off-by Gerd Hoffmann <[email protected]>
--- tests/rtc-test.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)
tests/rtc-test.c +4 -0
@@ -201,6 +201,10 @@ static void set_year_20xx(void) g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11); g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20); +if (sizeof (time_t) ==32 ) { +return ; + } +/* Set a date in 2080 to ensure there is no year-2038 overflow. */ cmos_write (RTC_REG_A ,0x76 );cmos_write (RTC_YEAR ,0x80 );
Signature · 1 line
1.7.1
Am 04.01.2013 10:43, schrieb Gerd Hoffmann:
Quoted 10 lines
Signed-off-by Gerd Hoffmann <[email protected]>--- tests/rtc-test.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-)tests/rtc-test.c +0
-0
tests/rtc-test.c static void set_year_20xx(void) · line 204
Quoted 4 lines
tests/rtc-test.c +1
-0@@ -201,6 +201,10 @@ static void set_year_20xx(void) g_assert_cmpint(cmos_read(RTC_YEAR), ==, 0x11); g_assert_cmpint(cmos_read(RTC_CENTURY), ==, 0x20); +if (sizeof (time_t) ==32 ) {
You sure that shouldn't be 4 then?
Andreas
Quoted 6 lines
tests/rtc-test.c +3
-0+return ; + } +/* Set a date in 2080 to ensure there is no year-2038 overflow. */ cmos_write (RTC_REG_A ,0x76 );cmos_write (RTC_YEAR ,0x80 );
Signature · 2 lines
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
Hi,
Quoted 3 lines
Quoted 1 line
+ if (
sizeof(time_t)== 32) {You sure that shouldn't be 4 then?
Oops, yes. Should have waited for buildbot results ...
cheers,
Gerd