summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-resolve
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd/sd-resolve')
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c20
-rw-r--r--src/libsystemd/sd-resolve/test-resolve.c6
2 files changed, 13 insertions, 13 deletions
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 803190f02b..f05fe10b6a 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -914,10 +914,10 @@ static int alloc_query(sd_resolve *resolve, sd_resolve_query **_q) {
_public_ int sd_resolve_getaddrinfo(
sd_resolve *resolve,
+ sd_resolve_query **_q,
const char *node,
const char *service,
- const struct addrinfo *hints,
- sd_resolve_query **_q) {
+ const struct addrinfo *hints) {
AddrInfoRequest req = {};
struct msghdr mh = {};
@@ -1007,10 +1007,10 @@ _public_ int sd_resolve_getaddrinfo_done(sd_resolve_query* q, struct addrinfo **
_public_ int sd_resolve_getnameinfo(
sd_resolve *resolve,
+ sd_resolve_query**_q,
const struct sockaddr *sa, socklen_t salen,
int flags,
- int gethost, int getserv,
- sd_resolve_query**_q) {
+ int gethost, int getserv) {
NameInfoRequest req = {};
struct msghdr mh = {};
@@ -1098,10 +1098,10 @@ _public_ int sd_resolve_getnameinfo_done(sd_resolve_query* q, char **ret_host, c
static int resolve_res(
sd_resolve *resolve,
+ sd_resolve_query **_q,
QueryType qtype,
const char *dname,
- int class, int type,
- sd_resolve_query **_q) {
+ int class, int type) {
struct msghdr mh = {};
struct iovec iov[2];
@@ -1141,12 +1141,12 @@ static int resolve_res(
return 0;
}
-_public_ int sd_resolve_res_query(sd_resolve *resolve, const char *dname, int class, int type, sd_resolve_query** q) {
- return resolve_res(resolve, REQUEST_RES_QUERY, dname, class, type, q);
+_public_ int sd_resolve_res_query(sd_resolve *resolve, sd_resolve_query** q, const char *dname, int class, int type) {
+ return resolve_res(resolve, q, REQUEST_RES_QUERY, dname, class, type);
}
-_public_ int sd_resolve_res_search(sd_resolve *resolve, const char *dname, int class, int type, sd_resolve_query** q) {
- return resolve_res(resolve, REQUEST_RES_SEARCH, dname, class, type, q);
+_public_ int sd_resolve_res_search(sd_resolve *resolve, sd_resolve_query** q, const char *dname, int class, int type) {
+ return resolve_res(resolve, q, REQUEST_RES_SEARCH, dname, class, type);
}
_public_ int sd_resolve_res_done(sd_resolve_query* q, unsigned char **answer) {
diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c
index 2e4981df7f..d3b2d55ec0 100644
--- a/src/libsystemd/sd-resolve/test-resolve.c
+++ b/src/libsystemd/sd-resolve/test-resolve.c
@@ -52,7 +52,7 @@ int main(int argc, char *argv[]) {
hints.ai_socktype = SOCK_STREAM;
hints.ai_flags = AI_CANONNAME;
- r = sd_resolve_getaddrinfo(resolve, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints, &q1);
+ r = sd_resolve_getaddrinfo(resolve, &q1, argc >= 2 ? argv[1] : "www.heise.de", NULL, &hints);
if (r < 0)
log_error("sd_resolve_getaddrinfo(): %s\n", strerror(-r));
@@ -61,12 +61,12 @@ int main(int argc, char *argv[]) {
sa.sin_addr.s_addr = inet_addr(argc >= 3 ? argv[2] : "193.99.144.71");
sa.sin_port = htons(80);
- r = sd_resolve_getnameinfo(resolve, (struct sockaddr*) &sa, sizeof(sa), 0, true, true, &q2);
+ r = sd_resolve_getnameinfo(resolve, &q2, (struct sockaddr*) &sa, sizeof(sa), 0, true, true);
if (r < 0)
log_error("sd_resolve_getnameinfo(): %s\n", strerror(-r));
/* Make a res_query() call */
- r = sd_resolve_res_query(resolve, "_xmpp-client._tcp.gmail.com", C_IN, T_SRV, &q3);
+ r = sd_resolve_res_query(resolve, &q3, "_xmpp-client._tcp.gmail.com", C_IN, T_SRV);
if (r < 0)
log_error("sd_resolve_res_query(): %s\n", strerror(-r));