diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2018-05-10 16:13:16 +0300 |
---|---|---|
committer | rl1987 <rl1987@sdf.lonestar.org> | 2018-05-10 16:13:16 +0300 |
commit | 36f7d0a940bbe8695d5343fccc1a0560a529883a (patch) | |
tree | 5351643e28acaaff2e7a9a1d2162fad54095dd96 /src/test/test_policy.c | |
parent | b8ed6e2ac6226c9cf43d28533c7f7eb3315be150 (diff) | |
download | tor-36f7d0a940bbe8695d5343fccc1a0560a529883a.tar.gz tor-36f7d0a940bbe8695d5343fccc1a0560a529883a.zip |
Make _with_err return routerinfo, like old function does
Diffstat (limited to 'src/test/test_policy.c')
-rw-r--r-- | src/test/test_policy.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/test/test_policy.c b/src/test/test_policy.c index aeddc14178..6ae57be8ce 100644 --- a/src/test/test_policy.c +++ b/src/test/test_policy.c @@ -1498,16 +1498,20 @@ test_dump_exit_policy_to_string(void *arg) static routerinfo_t *mock_desc_routerinfo = NULL; static int routerinfo_err; -static int -mock_router_get_my_routerinfo_with_err(routerinfo_t **ri) +static const routerinfo_t * +mock_router_get_my_routerinfo_with_err(int *err) { - if (routerinfo_err) - return routerinfo_err; + if (routerinfo_err) { + if (err) + *err = routerinfo_err; - if (ri) - *ri = mock_desc_routerinfo; + return NULL; + } - return 0; + if (err) + *err = 0; + + return mock_desc_routerinfo; } #define DEFAULT_POLICY_STRING "reject *:*" |