summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Mack <github@zonque.org>2016-01-07 17:40:42 +0100
committerDaniel Mack <github@zonque.org>2016-01-07 17:40:42 +0100
commite056af1807d8c8d0c84509cfb87e2a1210c3d77f (patch)
tree8c4ad117377f53b5a785ba07d282a20af76fff97 /src
parente67f68cc26cc8ac3811699f2fa6f354b62faeb40 (diff)
parent1e87f1f2a86d8d0d0f2a264fd7a8cd2bce88c445 (diff)
Merge pull request #2285 from evverx/fix-test-resolve
tests: test-resolve: wait until all queries are completed
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd/sd-resolve/test-resolve.c8
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");