diff options
| author | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-05 21:22:25 +0000 |
|---|---|---|
| committer | Quentin Young <qlyoung@cumulusnetworks.com> | 2017-05-09 20:44:22 +0000 |
| commit | 66e78ae64bc4659848517953b365606e3e70e878 (patch) | |
| tree | ef1339e397feed2b56b8d653d41c03aa5b2bd94f /tests/lib/test_timer_correctness.c | |
| parent | 32d86f8b7a327cfc6904d51d5c3ea8f5c6115e44 (diff) | |
*: update thread_add_* calls
Pass pointer to pointer instead of assigning by return value. See
previous commit message.
To ensure that the behavior stays functionally correct, any assignments
with the result of a thread_add* function have been transformed to set
the pointer to null before passing it. These can be removed wherever the
pointer is known to already be null.
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
Diffstat (limited to 'tests/lib/test_timer_correctness.c')
| -rw-r--r-- | tests/lib/test_timer_correctness.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/lib/test_timer_correctness.c b/tests/lib/test_timer_correctness.c index 600aef6f46..b0643b907b 100644 --- a/tests/lib/test_timer_correctness.c +++ b/tests/lib/test_timer_correctness.c @@ -139,8 +139,9 @@ int main(int argc, char **argv) /* Schedule timers to expire in 0..5 seconds */ interval_msec = prng_rand(prng) % 5000; arg = XMALLOC(MTYPE_TMP, TIMESTR_LEN + 1); - timers[i] = thread_add_timer_msec(master, timer_func, arg, - interval_msec, NULL); + timers[i] = NULL; + thread_add_timer_msec(master, timer_func, arg, interval_msec, + &timers[i]); ret = snprintf(arg, TIMESTR_LEN + 1, "%lld.%06lld", (long long)timers[i]->u.sands.tv_sec, (long long)timers[i]->u.sands.tv_usec); |
