mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 11:42:27 +00:00
If a timezone is not specified, assume localtime (instead of gmtime) (Issue #7748)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@51255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -56,6 +56,7 @@
|
|||||||
#include "tzfile.h"
|
#include "tzfile.h"
|
||||||
#include "asterisk/lock.h"
|
#include "asterisk/lock.h"
|
||||||
#include "asterisk/localtime.h"
|
#include "asterisk/localtime.h"
|
||||||
|
#include "asterisk/strings.h"
|
||||||
|
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
@@ -1051,7 +1052,7 @@ const char * const zone;
|
|||||||
#ifdef _THREAD_SAFE
|
#ifdef _THREAD_SAFE
|
||||||
ast_mutex_lock(&lcl_mutex);
|
ast_mutex_lock(&lcl_mutex);
|
||||||
#endif
|
#endif
|
||||||
ast_tzset(zone);
|
ast_tzset(ast_strlen_zero(zone) ? "/etc/localtime" : zone);
|
||||||
localsub(timep, 0L, p_tm, zone);
|
localsub(timep, 0L, p_tm, zone);
|
||||||
#ifdef _THREAD_SAFE
|
#ifdef _THREAD_SAFE
|
||||||
ast_mutex_unlock(&lcl_mutex);
|
ast_mutex_unlock(&lcl_mutex);
|
||||||
@@ -1495,8 +1496,8 @@ const char * const zone;
|
|||||||
#ifdef _THREAD_SAFE
|
#ifdef _THREAD_SAFE
|
||||||
ast_mutex_lock(&lcl_mutex);
|
ast_mutex_lock(&lcl_mutex);
|
||||||
#endif
|
#endif
|
||||||
ast_tzset(zone);
|
ast_tzset(!ast_strlen_zero(zone) ? zone : "/etc/localtime");
|
||||||
mktime_return_value = time1(tmp, localsub, 0L, zone);
|
mktime_return_value = time1(tmp, localsub, 0L, !ast_strlen_zero(zone) ? zone : "/etc/localtime");
|
||||||
#ifdef _THREAD_SAFE
|
#ifdef _THREAD_SAFE
|
||||||
ast_mutex_unlock(&lcl_mutex);
|
ast_mutex_unlock(&lcl_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user