* Gets the proper timezone in a more portable fashion * i.e timezone variables are linux specific. */
| 777 | * i.e timezone variables are linux specific. |
| 778 | */ |
| 779 | long getTimeZone(void) { |
| 780 | #if defined(__linux__) || defined(__sun) |
| 781 | return timezone; |
| 782 | #else |
| 783 | struct timeval tv; |
| 784 | struct timezone tz; |
| 785 | |
| 786 | gettimeofday(&tv, &tz); |
| 787 | |
| 788 | return tz.tz_minuteswest * 60L; |
| 789 | #endif |
| 790 | } |
| 791 | |
| 792 | /* Return true if the specified path is just a file basename without any |
| 793 | * relative or absolute path. This function just checks that no / or \ |