diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-15 23:00:47 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-07-15 23:00:47 +0000 |
commit | ff15e0fa53156b9994da3f726bfe91232de6195a (patch) | |
tree | 896015cada90b49858e1bf6503d9583704a56179 /funcs/func_strings.c | |
parent | c05cf07847cb384ba66aa29d5eda580eda413ffb (diff) |
add a library of timeval manipulation functions, and change a large number of usses to use the new functions (bug #4504)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@6146 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rwxr-xr-x | funcs/func_strings.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index de7015190..7b6e072a0 100755 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -127,7 +127,6 @@ static char *acf_strftime(struct ast_channel *chan, char *cmd, char *data, char { char *format, *epoch, *timezone; long epochi; - struct timeval tv; struct tm time; if (data) { @@ -137,11 +136,9 @@ static char *acf_strftime(struct ast_channel *chan, char *cmd, char *data, char timezone = strsep(&format, "|"); if (epoch && !ast_strlen_zero(epoch) && sscanf(epoch, "%ld", &epochi) == 1) { - } else if (!gettimeofday(&tv, NULL)) { - epochi = tv.tv_sec; } else { - ast_log(LOG_ERROR, "Cannot gettimeofday() ?!!\n"); - return ""; + struct timeval tv = ast_tvnow(); + epochi = tv.tv_sec; } ast_localtime(&epochi, &time, timezone); |