equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
121 if (entry == NULL) { |
121 if (entry == NULL) { |
122 (void) closedir(dirp); |
122 (void) closedir(dirp); |
123 return NULL; |
123 return NULL; |
124 } |
124 } |
125 |
125 |
126 #if defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ |
126 #if defined(_AIX) || defined(__linux__) || defined(MACOSX) || (defined(__solaris__) \ |
127 && (defined(_POSIX_PTHREAD_SEMANTICS) || defined(_LP64))) |
127 && (defined(_POSIX_PTHREAD_SEMANTICS) || defined(_LP64))) |
128 while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) { |
128 while (readdir_r(dirp, entry, &dp) == 0 && dp != NULL) { |
129 #else |
129 #else |
130 while ((dp = readdir_r(dirp, entry)) != NULL) { |
130 while ((dp = readdir_r(dirp, entry)) != NULL) { |
131 #endif |
131 #endif |
613 return tz; |
613 return tz; |
614 } |
614 } |
615 #endif /*__solaris__*/ |
615 #endif /*__solaris__*/ |
616 #endif /*__linux__*/ |
616 #endif /*__linux__*/ |
617 |
617 |
|
618 #ifdef _AIX |
|
619 static char * |
|
620 getPlatformTimeZoneID() |
|
621 { |
|
622 return NULL; |
|
623 } |
|
624 #endif |
|
625 |
618 /* |
626 /* |
619 * findJavaTZ_md() maps platform time zone ID to Java time zone ID |
627 * findJavaTZ_md() maps platform time zone ID to Java time zone ID |
620 * using <java_home>/lib/tzmappings. If the TZ value is not found, it |
628 * using <java_home>/lib/tzmappings. If the TZ value is not found, it |
621 * trys some libc implementation dependent mappings. If it still |
629 * trys some libc implementation dependent mappings. If it still |
622 * can't map to a Java time zone ID, it falls back to the GMT+/-hh:mm |
630 * can't map to a Java time zone ID, it falls back to the GMT+/-hh:mm |
633 tz = getenv("TZ"); |
641 tz = getenv("TZ"); |
634 |
642 |
635 #if defined(__linux__) || defined(_ALLBSD_SOURCE) |
643 #if defined(__linux__) || defined(_ALLBSD_SOURCE) |
636 if (tz == NULL) { |
644 if (tz == NULL) { |
637 #else |
645 #else |
638 #ifdef __solaris__ |
646 #if defined (__solaris__) || defined(_AIX) |
639 if (tz == NULL || *tz == '\0') { |
647 if (tz == NULL || *tz == '\0') { |
640 #endif |
648 #endif |
641 #endif |
649 #endif |
642 tz = getPlatformTimeZoneID(); |
650 tz = getPlatformTimeZoneID(); |
643 freetz = tz; |
651 freetz = tz; |