[vlc-commits] posix/getaddrinfo: simplify
Rémi Denis-Courmont
git at videolan.org
Mon Feb 17 17:20:57 CET 2020
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Feb 16 17:28:40 2020 +0200| [d4038a6b712b96be8182bd3c92673d0045706678] | committer: Rémi Denis-Courmont
posix/getaddrinfo: simplify
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d4038a6b712b96be8182bd3c92673d0045706678
---
src/posix/getaddrinfo.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/posix/getaddrinfo.c b/src/posix/getaddrinfo.c
index 4863beada4..7ce457e775 100644
--- a/src/posix/getaddrinfo.c
+++ b/src/posix/getaddrinfo.c
@@ -35,7 +35,7 @@ struct vlc_gai_req
const char *name;
const char *service;
const struct addrinfo *hints;
- struct addrinfo *result;
+ struct addrinfo **result;
int error;
vlc_sem_t done;
};
@@ -45,8 +45,7 @@ static void *vlc_gai_thread(void *data)
struct vlc_gai_req *req = data;
req->error = EAI_SYSTEM;
- req->error = getaddrinfo(req->name, req->service, req->hints,
- &req->result);
+ req->error = getaddrinfo(req->name, req->service, req->hints, req->result);
vlc_sem_post(&req->done);
return NULL;
}
@@ -60,6 +59,7 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port,
.name = name,
.service = NULL,
.hints = hints,
+ .result = res,
};
char portbuf[6];
vlc_thread_t th;
@@ -87,6 +87,5 @@ int vlc_getaddrinfo_i11e(const char *name, unsigned port,
vlc_join(th, NULL);
vlc_sem_destroy(&req.done);
- *res = req.result;
return req.error;
}
More information about the vlc-commits
mailing list