mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
add a library of timeval manipulation functions, and change a large number of usses to use the new functions (bug #4504)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@6146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1199,7 +1199,7 @@ static char *cli_prompt(EditLine *el)
|
||||
break;
|
||||
case 'd': /* date */
|
||||
memset(&tm, 0, sizeof(struct tm));
|
||||
gettimeofday(&tv, NULL);
|
||||
tv = ast_tvnow();
|
||||
if (localtime_r(&(tv.tv_sec), &tm)) {
|
||||
strftime(p, sizeof(prompt) - strlen(prompt), "%Y-%m-%d", &tm);
|
||||
}
|
||||
@@ -1256,7 +1256,7 @@ static char *cli_prompt(EditLine *el)
|
||||
#endif
|
||||
case 't': /* time */
|
||||
memset(&tm, 0, sizeof(struct tm));
|
||||
gettimeofday(&tv, NULL);
|
||||
tv = ast_tvnow();
|
||||
if (localtime_r(&(tv.tv_sec), &tm)) {
|
||||
strftime(p, sizeof(prompt) - strlen(prompt), "%H:%M:%S", &tm);
|
||||
}
|
||||
|
Reference in New Issue
Block a user