aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorPiotr Sikora <[email protected]>2012-07-14 04:16:04 +0000
committerHenrik Nord <[email protected]>2012-08-01 09:56:10 +0200
commit99f6356e35b89446487bcdd787ed9b0657ae6b71 (patch)
treeb7ac47f47650f0d0805668f4c3b14e8970650c18 /erts/emulator
parentffcdf6f983bd9b7005abc2e69c4a0f187b8493f6 (diff)
downloadotp-99f6356e35b89446487bcdd787ed9b0657ae6b71.tar.gz
otp-99f6356e35b89446487bcdd787ed9b0657ae6b71.tar.bz2
otp-99f6356e35b89446487bcdd787ed9b0657ae6b71.zip
Fix use of "clever" mktime
Commit 1eef765 introduced regression (conditional _always_ evaluates to true) in which erlang:localtime_to_universaltime/2 stopped working on systems configured with timezone without DST (i.e. UTC) on *BSD platforms: 1> erlang:localtime_to_universaltime({{2012,1,1},{0,0,0}}, true). ** exception error: bad argument Signed-off-by: Piotr Sikora <[email protected]>
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_time_sup.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_time_sup.c b/erts/emulator/beam/erl_time_sup.c
index 1d0735aa99..e6962a700b 100644
--- a/erts/emulator/beam/erl_time_sup.c
+++ b/erts/emulator/beam/erl_time_sup.c
@@ -757,7 +757,7 @@ local_to_univ(Sint *year, Sint *month, Sint *day,
refuses to give us a DST time, we simulate the Linux/Solaris
behaviour of giving the same data as if is_dst was not set. */
t.tm_isdst = 0;
- if (erl_mktime(&the_clock, &t)) {
+ if (erl_mktime(&the_clock, &t) < 0) {
/* Failed anyway, something else is bad - will be a badarg */
return 0;
}