mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-12 23:00:22 +02:00
(scm_gmtime): Return bd_time->tm_zone when available, rather than "GMT" always.
(filltime): Make zname parameter "const".
This commit is contained in:
parent
82ab7b189b
commit
d6d9e95746
1 changed files with 8 additions and 2 deletions
|
@ -255,7 +255,7 @@ SCM_DEFINE (scm_gettimeofday, "gettimeofday", 0, 0, 0,
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
||||||
static SCM
|
static SCM
|
||||||
filltime (struct tm *bd_time, int zoff, char *zname)
|
filltime (struct tm *bd_time, int zoff, const char *zname)
|
||||||
{
|
{
|
||||||
SCM result = scm_c_make_vector (11, SCM_UNDEFINED);
|
SCM result = scm_c_make_vector (11, SCM_UNDEFINED);
|
||||||
|
|
||||||
|
@ -405,6 +405,7 @@ SCM_DEFINE (scm_gmtime, "gmtime", 1, 0, 0,
|
||||||
timet itime;
|
timet itime;
|
||||||
struct tm *bd_time;
|
struct tm *bd_time;
|
||||||
SCM result;
|
SCM result;
|
||||||
|
const char *zname;
|
||||||
|
|
||||||
itime = SCM_NUM2LONG (1, time);
|
itime = SCM_NUM2LONG (1, time);
|
||||||
SCM_DEFER_INTS;
|
SCM_DEFER_INTS;
|
||||||
|
@ -414,7 +415,12 @@ SCM_DEFINE (scm_gmtime, "gmtime", 1, 0, 0,
|
||||||
bd_time = gmtime (&itime);
|
bd_time = gmtime (&itime);
|
||||||
if (bd_time == NULL)
|
if (bd_time == NULL)
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
result = filltime (bd_time, 0, "GMT");
|
#if HAVE_STRUCT_TM_TM_ZONE
|
||||||
|
zname = bd_time->tm_zone;
|
||||||
|
#else
|
||||||
|
zname = "GMT";
|
||||||
|
#endif
|
||||||
|
result = filltime (bd_time, 0, zname);
|
||||||
SCM_ALLOW_INTS;
|
SCM_ALLOW_INTS;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue