try to use clock_gettime to make sure we don't care if the system time changes

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7165 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2008-01-11 00:43:49 +00:00
1 parent 886f99735a
commit 143bed09a3
38 files changed
+174 -104

No files matched your search

@@ -87,7 +87,7 @@ static void do_rotate(cdr_fd_t *fd)
close(fd->fd);
if (globals.rotate) {
switch_time_exp_lt(&tm, switch_time_now());
switch_time_exp_lt(&tm, switch_timestamp_now());
switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d-%H-%M-%S", &tm);
len = strlen(fd->path) + strlen(date) + 2;
@@ -354,7 +354,7 @@ static switch_status_t read_packet(listener_t * listener, switch_event_t **event
uint32_t max_len = sizeof(mbuf);
switch_channel_t *channel = NULL;
*event = NULL;
start = time(NULL);
start = switch_timestamp(NULL);
ptr = mbuf;
@@ -436,7 +436,7 @@ static switch_status_t read_packet(listener_t * listener, switch_event_t **event
}
if (timeout) {
elapsed = (uint32_t) (time(NULL) - start);
elapsed = (uint32_t) (switch_timestamp(NULL) - start);
if (elapsed >= timeout) {
switch_clear_flag_locked(listener, LFLAG_RUNNING);
return SWITCH_STATUS_FALSE;