summaryrefslogtreecommitdiff
path: root/docs/examples/multithread.c
diff options
context:
space:
mode:
authorMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-20 11:50:23 +0200
committerMarcel Raad <Marcel.Raad@teamviewer.com>2019-05-21 09:47:03 +0200
commitb069815a7ac245c9c794c173de411f3d4d051531 (patch)
treee42298572ba8da3fc3f0485fca11c94489a051b8 /docs/examples/multithread.c
parent528b284e4b145ff38c5ab87b4d6daa5d796fd938 (diff)
downloadgnurl-b069815a7ac245c9c794c173de411f3d4d051531.tar.gz
gnurl-b069815a7ac245c9c794c173de411f3d4d051531.tar.bz2
gnurl-b069815a7ac245c9c794c173de411f3d4d051531.zip
examples: remove unused variables
Fixes Codacy/CppCheck warnings. Closes
Diffstat (limited to 'docs/examples/multithread.c')
-rw-r--r--docs/examples/multithread.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/docs/examples/multithread.c b/docs/examples/multithread.c
index 83ed3f589..a162000da 100644
--- a/docs/examples/multithread.c
+++ b/docs/examples/multithread.c
@@ -69,16 +69,15 @@ int main(int argc, char **argv)
{
pthread_t tid[NUMT];
int i;
- int error;
/* Must initialize libcurl before any threads are started */
curl_global_init(CURL_GLOBAL_ALL);
for(i = 0; i< NUMT; i++) {
- error = pthread_create(&tid[i],
- NULL, /* default attributes please */
- pull_one_url,
- (void *)urls[i]);
+ int error = pthread_create(&tid[i],
+ NULL, /* default attributes please */
+ pull_one_url,
+ (void *)urls[i]);
if(0 != error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
@@ -87,7 +86,7 @@ int main(int argc, char **argv)
/* now wait for all threads to terminate */
for(i = 0; i< NUMT; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}