summaryrefslogtreecommitdiffstats
path: root/gcc/ada/sysdep.c
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-17 09:35:50 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2009-08-17 09:35:50 +0000
commit8aa885d03314fbb19d35723fb007a78d5d54cf8e (patch)
treef6706d5d774f7bc84126c8a56a3a088725140fd7 /gcc/ada/sysdep.c
parent70efb34b297972a148f245759052323aa1e5b52c (diff)
downloadppe42-gcc-8aa885d03314fbb19d35723fb007a78d5d54cf8e.tar.gz
ppe42-gcc-8aa885d03314fbb19d35723fb007a78d5d54cf8e.zip
2009-08-17 Robert Dewar <dewar@adacore.com>
* prj-env.adb: Minor reformatting * sem_ch3.adb: Minor reformatting 2009-08-17 Hristian Kirtchev <kirtchev@adacore.com> * sysdep.c (__gnat_localtime_tzoff): VxWorks case - Flip the sign of the time zone since VxWorks chose positive values to represent west time zones and negative for east zones. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@150826 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sysdep.c')
-rw-r--r--gcc/ada/sysdep.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index ffda3abaeec..6019fd9cf91 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -868,6 +868,8 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
(*Unlock_Task) ();
+ /* Correct the offset if Daylight Saving Time is in effect */
+
if (tp.tm_isdst > 0)
*off = *off + 3600;
}
@@ -902,9 +904,16 @@ __gnat_localtime_tzoff (const time_t *timer, long *off)
tz_end = index (tz_start, ':');
tz_end = '\0';
- /* The Ada layer expects an offset in seconds */
+ /* The Ada layer expects an offset in seconds. Note that we must reverse
+ the sign of the result since west is positive and east is negative on
+ VxWorks targets. */
+
+ *off = -atol (tz_start) * 60;
+
+ /* Correct the offset if Daylight Saving Time is in effect */
- *off = atol (tz_start) * 60;
+ if (tp.tm_isdst > 0)
+ *off = *off - 3600;
}
(*Unlock_Task) ();
OpenPOWER on IntegriCloud