diff options
author | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 21:03:56 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@gnumonks.org> | 2012-08-04 21:03:56 +0200 |
commit | d2ea108728cc74c231c0b659709a39d887e16cc5 (patch) | |
tree | a24561a8fd79f812f5a6f85a3decc56b05241e1d /src | |
parent | 81979fa80a814ece2c6a7f3f8a7a85822758cad5 (diff) |
osmux: remove timeval parameter from osmux_tx_sched
We can internal allocate this in the stack, no need to expose it to
the caller.
Diffstat (limited to 'src')
-rw-r--r-- | src/osmux.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/osmux.c b/src/osmux.c index 2132a91..98b1e27 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -424,19 +424,22 @@ osmux_tx(struct msgb *msg, struct timeval *when, } void -osmux_tx_sched(struct llist_head *list, struct timeval *when, +osmux_tx_sched(struct llist_head *list, void (*tx_cb)(struct msgb *msg, void *data), void *data) { struct msgb *cur, *tmp; struct timeval delta = { .tv_sec = 0, .tv_usec = DELTA_RTP_MSG }; + struct timeval when; + + timerclear(&when); llist_for_each_entry_safe(cur, tmp, list, list) { LOGP(DOSMUX, LOGL_DEBUG, "scheduled transmision in %lu.%6lu " - "seconds, msg=%p\n", when->tv_sec, when->tv_usec, cur); + "seconds, msg=%p\n", when.tv_sec, when.tv_usec, cur); - osmux_tx(cur, when, tx_cb, NULL); - timeradd(when, &delta, when); + osmux_tx(cur, &when, tx_cb, NULL); + timeradd(&when, &delta, &when); llist_del(&cur->list); } } |