summaryrefslogtreecommitdiff
path: root/ratox.c
diff options
context:
space:
mode:
authorz3bra <contactatz3bradotorg>2016-11-25 18:09:09 +0100
committerz3bra <contactatz3bradotorg>2016-11-25 18:09:09 +0100
commitd81013a3063e918ba30bf83e6255619ba2b108c0 (patch)
treeae92af202ac9b2e6b405bb5b1b36a4d752801f47 /ratox.c
parent305dda72d9daaa7bd7324e53a78fe6b999d373a4 (diff)
Make ringing delay checks simpler
Diffstat (limited to 'ratox.c')
-rw-r--r--ratox.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/ratox.c b/ratox.c
index d05f800..9a2b9f6 100644
--- a/ratox.c
+++ b/ratox.c
@@ -1551,9 +1551,8 @@ loop(void)
struct friend *f, *ftmp;
struct request *req, *rtmp;
struct timeval tv;
- struct timespec callstart, now;
fd_set rfds;
- time_t t0, t1;
+ time_t t0, t1, c0, c1;
size_t i;
int connected = 0, n, r, fd, fdmax;
char tstamp[64], c;
@@ -1681,8 +1680,8 @@ loop(void)
if (f->av.state & RINGING) {
if (f->av.state & OUTGOING) {
- clock_gettime(CLOCK_MONOTONIC, &now);
- if (now.tv_sec - callstart.tv_sec > RINGINGDELAY)
+ c1 = time(NULL);
+ if (c1 > c0 + RINGINGDELAY)
cancelcall(f, "Timeout");
}
if (!(f->av.state & INCOMING))
@@ -1767,7 +1766,7 @@ loop(void)
fiforeset(f->dirfd, &f->fd[FCALL_IN], ffiles[FCALL_IN]);
break;
}
- clock_gettime(CLOCK_MONOTONIC, &callstart);
+ c0 = time(NULL);
f->av.n = 0;
f->av.lastsent.tv_sec = 0;
f->av.lastsent.tv_nsec = 0;