Update of /usr/cvsroot/asterisk/funcs
In directory mongoose.digium.com:/tmp/cvs-serv13236/funcs
Modified Files:
func_strings.c
Log Message:
add a library of timeval manipulation functions, and change a large number of
usses to use the new functions (bug #4504)
Index: func_strings.c
===================================================================
RCS file: /usr/cvsroot/asterisk/funcs/func_strings.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- func_strings.c 6 Jun 2005 22:12:19 -0000 1.5
+++ func_strings.c 15 Jul 2005 23:00:47 -0000 1.6
@@ -127,7 +127,6 @@
{
char *format, *epoch, *timezone;
long epochi;
- struct timeval tv;
struct tm time;
if (data) {
@@ -137,11 +136,9 @@
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);
_______________________________________________
Asterisk-Cvs mailing list
[email protected]
http://lists.digium.com/mailman/listinfo/asterisk-cvs