mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 00:30:53 +00:00
Use tzset to find timezone info.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@17615 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
163e5e6018
commit
b69faecbee
5 changed files with 30 additions and 6 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2003-09-02 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* configure.ac: Check for tzset
|
||||||
|
* Source/NSTimeZone.m (+systemTimeZone): Use it to find time zone
|
||||||
|
(as a last resort).
|
||||||
|
|
||||||
2003-09-02 Adam Fedor <fedor@gnu.org>
|
2003-09-02 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Tools/gdnc.m (main): Don't mess with file descriptors on MinGW.
|
* Tools/gdnc.m (main): Don't mess with file descriptors on MinGW.
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
/* Define if SO_REUSEADDR is broken on this system */
|
/* Define if SO_REUSEADDR is broken on this system */
|
||||||
#undef BROKEN_SO_REUSEADDR
|
#undef BROKEN_SO_REUSEADDR
|
||||||
|
|
||||||
/* Define if your system terminates the final argument in /proc/28891/cmdline */
|
/* Define if your system terminates the final argument in /proc/$$/cmdline */
|
||||||
#undef CMDLINE_TERMINATED
|
#undef CMDLINE_TERMINATED
|
||||||
|
|
||||||
/* Define if constructors are automatically loaded */
|
/* Define if constructors are automatically loaded */
|
||||||
|
@ -121,6 +121,9 @@
|
||||||
/* Define to 1 if you have the `mmap' function. */
|
/* Define to 1 if you have the `mmap' function. */
|
||||||
#undef HAVE_MMAP
|
#undef HAVE_MMAP
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `nanosleep' function. */
|
||||||
|
#undef HAVE_NANOSLEEP
|
||||||
|
|
||||||
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
|
||||||
#undef HAVE_NDIR_H
|
#undef HAVE_NDIR_H
|
||||||
|
|
||||||
|
@ -282,6 +285,9 @@
|
||||||
/* Define to 1 if you have the <time.h> header file. */
|
/* Define to 1 if you have the <time.h> header file. */
|
||||||
#undef HAVE_TIME_H
|
#undef HAVE_TIME_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the `tzset' function. */
|
||||||
|
#undef HAVE_TZSET
|
||||||
|
|
||||||
/* Define to 1 if you have the <ucbinclude/sys/resource.h> header file. */
|
/* Define to 1 if you have the <ucbinclude/sys/resource.h> header file. */
|
||||||
#undef HAVE_UCBINCLUDE_SYS_RESOURCE_H
|
#undef HAVE_UCBINCLUDE_SYS_RESOURCE_H
|
||||||
|
|
||||||
|
@ -291,9 +297,6 @@
|
||||||
/* Define to 1 if you have the <unistd.h> header file. */
|
/* Define to 1 if you have the <unistd.h> header file. */
|
||||||
#undef HAVE_UNISTD_H
|
#undef HAVE_UNISTD_H
|
||||||
|
|
||||||
/* Define to 1 if you have the `nanosleep' function. */
|
|
||||||
#undef HAVE_NANOSLEEP
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `usleep' function. */
|
/* Define to 1 if you have the `usleep' function. */
|
||||||
#undef HAVE_USLEEP
|
#undef HAVE_USLEEP
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <time.h>
|
||||||
#include "Foundation/NSArray.h"
|
#include "Foundation/NSArray.h"
|
||||||
#include "Foundation/NSCoder.h"
|
#include "Foundation/NSCoder.h"
|
||||||
#include "Foundation/NSData.h"
|
#include "Foundation/NSData.h"
|
||||||
|
@ -1123,6 +1124,18 @@ static NSMapTable *absolutes = 0;
|
||||||
localZoneString = [localZoneString stringByTrimmingSpaces];
|
localZoneString = [localZoneString stringByTrimmingSpaces];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#if HAVE_TZSET
|
||||||
|
if (localZoneString == nil)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* Try to get timezone from tzset and tzname
|
||||||
|
*/
|
||||||
|
extern char *tzname[2];
|
||||||
|
tzset();
|
||||||
|
if (tzname[0] != NULL && *tzname[0] != '\0')
|
||||||
|
localZoneString = [NSString stringWithCString: tzname[0]];
|
||||||
|
}
|
||||||
|
#else
|
||||||
if (localZoneString == nil)
|
if (localZoneString == nil)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -1131,6 +1144,7 @@ static NSMapTable *absolutes = 0;
|
||||||
localZoneString = [[[NSProcessInfo processInfo]
|
localZoneString = [[[NSProcessInfo processInfo]
|
||||||
environment] objectForKey: @"TZ"];
|
environment] objectForKey: @"TZ"];
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
if (localZoneString != nil)
|
if (localZoneString != nil)
|
||||||
{
|
{
|
||||||
zone = [defaultPlaceholderTimeZone initWithName: localZoneString];
|
zone = [defaultPlaceholderTimeZone initWithName: localZoneString];
|
||||||
|
|
3
configure
vendored
3
configure
vendored
|
@ -8321,7 +8321,8 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_func in time ctime
|
|
||||||
|
for ac_func in time ctime tzset
|
||||||
do
|
do
|
||||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||||
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||||
|
|
|
@ -529,7 +529,7 @@ LIBS="$saved_LIBS"
|
||||||
dnl AC_REPLACE_FUNCS(getrusage gettimeofday)
|
dnl AC_REPLACE_FUNCS(getrusage gettimeofday)
|
||||||
|
|
||||||
AC_CHECK_HEADERS(time.h sys/time.h sys/rusage.h ucbinclude/sys/resource.h)
|
AC_CHECK_HEADERS(time.h sys/time.h sys/rusage.h ucbinclude/sys/resource.h)
|
||||||
AC_CHECK_FUNCS(time ctime)
|
AC_CHECK_FUNCS(time ctime tzset)
|
||||||
|
|
||||||
#--------------------------------------------------------------------
|
#--------------------------------------------------------------------
|
||||||
# These headers/functions needed by GSTcpPort.m
|
# These headers/functions needed by GSTcpPort.m
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue