From 1d173f3413235de45828301ad554314fc8384ddf Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Fri, 7 Sep 2018 16:15:24 +0200 Subject: docs/examples: do not wait when no transfers are running Closes #2948 --- docs/examples/multi-post.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs/examples/multi-post.c') diff --git a/docs/examples/multi-post.c b/docs/examples/multi-post.c index 95d71bea9..fe543312a 100644 --- a/docs/examples/multi-post.c +++ b/docs/examples/multi-post.c @@ -35,7 +35,7 @@ int main(void) CURL *curl; CURLM *multi_handle; - int still_running; + int still_running = 0; curl_mime *form = NULL; curl_mimepart *field = NULL; @@ -79,7 +79,7 @@ int main(void) curl_multi_perform(multi_handle, &still_running); - do { + while(still_running) { struct timeval timeout; int rc; /* select() return code */ CURLMcode mc; /* curl_multi_fdset() return code */ @@ -150,7 +150,7 @@ int main(void) printf("running: %d!\n", still_running); break; } - } while(still_running); + } curl_multi_cleanup(multi_handle); -- cgit v1.2.3