aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2012-08-27 14:58:10 +0200
committerFredrik Gustafsson <[email protected]>2012-08-27 14:58:10 +0200
commitfc5a483902f56839b5e331d5362c66cc6d35bed9 (patch)
treee3668b8f4e6b7bdcd8b423d9f3ba8ffd9342461d /erts
parent38d0c706e0ab69a58ca07c35c9d307e9a405f003 (diff)
parentc6fc61ffab426cc7b391eb903e7942bda809a230 (diff)
downloadotp-fc5a483902f56839b5e331d5362c66cc6d35bed9.tar.gz
otp-fc5a483902f56839b5e331d5362c66cc6d35bed9.tar.bz2
otp-fc5a483902f56839b5e331d5362c66cc6d35bed9.zip
Merge branch 'maint'
Diffstat (limited to 'erts')
-rw-r--r--erts/configure.in5
-rw-r--r--erts/emulator/beam/erl_time_sup.c10
2 files changed, 13 insertions, 2 deletions
diff --git a/erts/configure.in b/erts/configure.in
index 281f61f86e..8d70a1b74a 100644
--- a/erts/configure.in
+++ b/erts/configure.in
@@ -1882,9 +1882,10 @@ AC_CHECK_FUNCS([ieee_handler fpsetmask finite isnan isinf res_gethostbyname dlop
pread pwrite writev memmove strerror strerror_r strncasecmp \
gethrtime localtime_r gmtime_r inet_pton mmap mremap memcpy mallopt \
sbrk _sbrk __sbrk brk _brk __brk \
- flockfile fstat strlcpy strlcat setsid posix2time setlocale nl_langinfo poll])
+ flockfile fstat strlcpy strlcat setsid posix2time time2posix \
+ setlocale nl_langinfo poll])
-AC_CHECK_DECLS([posix2time],,,[#include <time.h>])
+AC_CHECK_DECLS([posix2time, time2posix],,,[#include <time.h>])
disable_vfork=false
if test "x$EMU_THR_LIB_NAME" != "x"; then
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index 05cbdfc7e5..e57e6a250d 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -754,6 +754,11 @@ int univ_to_seconds(Sint year, Sint month, Sint day, Sint hour, Sint minute, Sin
return 1;
}
+#if defined(HAVE_TIME2POSIX) && defined(HAVE_DECL_TIME2POSIX) && \
+ !HAVE_DECL_TIME2POSIX
+extern time_t time2posix(time_t);
+#endif
+
int
local_to_univ(Sint *year, Sint *month, Sint *day,
Sint *hour, Sint *minute, Sint *second, int isdst)
@@ -803,6 +808,11 @@ local_to_univ(Sint *year, Sint *month, Sint *day,
return 0;
}
}
+
+#ifdef HAVE_TIME2POSIX
+ the_clock = time2posix(the_clock);
+#endif
+
#ifdef HAVE_GMTIME_R
tm = gmtime_r(&the_clock, &tmbuf);
#else