diff options
author | Daniel Mack <github@zonque.org> | 2016-01-07 17:40:42 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2016-01-07 17:40:42 +0100 |
commit | e056af1807d8c8d0c84509cfb87e2a1210c3d77f (patch) | |
tree | 8c4ad117377f53b5a785ba07d282a20af76fff97 /src/libsystemd | |
parent | e67f68cc26cc8ac3811699f2fa6f354b62faeb40 (diff) | |
parent | 1e87f1f2a86d8d0d0f2a264fd7a8cd2bce88c445 (diff) |
Merge pull request #2285 from evverx/fix-test-resolve
tests: test-resolve: wait until all queries are completed
Diffstat (limited to 'src/libsystemd')
-rw-r--r-- | src/libsystemd/sd-resolve/test-resolve.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c index e78a75c9ea..ce97e81ed6 100644 --- a/src/libsystemd/sd-resolve/test-resolve.c +++ b/src/libsystemd/sd-resolve/test-resolve.c @@ -101,11 +101,11 @@ int main(int argc, char *argv[]) { if (r < 0) log_error_errno(r, "sd_resolve_getnameinfo(): %m"); - /* Wait until the two queries are completed */ - while (sd_resolve_query_is_done(q1) == 0 || - sd_resolve_query_is_done(q2) == 0) { - + /* Wait until all queries are completed */ + for (;;) { r = sd_resolve_wait(resolve, (uint64_t) -1); + if (r == 0) + break; if (r < 0) { log_error_errno(r, "sd_resolve_wait(): %m"); assert_not_reached("sd_resolve_wait() failed"); |