[vlc-devel] [PATCH] posix/getaddrinfo: simplify
RĂ©mi Denis-Courmont
remi at remlab.net
Sun Feb 16 16:29:32 CET 2020
---
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;
}
--
2.25.0
More information about the vlc-devel
mailing list