summary refs log tree commit diff
path: root/resolv/res_mkquery.c
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2017-06-30 11:31:18 +0200
committerFlorian Weimer <fweimer@redhat.com>2017-06-30 11:31:18 +0200
commit5ca4aaea1840b3005c2de4cc73269a55e34ae2c3 (patch)
tree35531f2226f91c60e31fa5f1e426f6bcb7ce242f /resolv/res_mkquery.c
parent74084febc4b668ca2258d88cade6fa5e28364ac6 (diff)
downloadglibc-5ca4aaea1840b3005c2de4cc73269a55e34ae2c3.tar.gz
glibc-5ca4aaea1840b3005c2de4cc73269a55e34ae2c3.tar.xz
glibc-5ca4aaea1840b3005c2de4cc73269a55e34ae2c3.zip
resolv: Move the res_mkquery function to the resolv/mk_query.c file
Diffstat (limited to 'resolv/res_mkquery.c')
-rw-r--r--resolv/res_mkquery.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/resolv/res_mkquery.c b/resolv/res_mkquery.c
index a601b69885..9afb410980 100644
--- a/resolv/res_mkquery.c
+++ b/resolv/res_mkquery.c
@@ -90,6 +90,7 @@
 #include <resolv/resolv-internal.h>
 #include <string.h>
 #include <sys/time.h>
+#include <shlib-compat.h>
 
 #include <hp-timing.h>
 #include <stdint.h>
@@ -202,6 +203,21 @@ res_nmkquery (res_state statp, int op, const char *dname,
 }
 libresolv_hidden_def (res_nmkquery)
 
+int
+res_mkquery (int op, const char *dname, int class, int type,
+             const unsigned char *data, int datalen,
+             const unsigned char *newrr_in,
+             unsigned char *buf, int buflen)
+{
+  if (__res_maybe_init (&_res, 1) == -1)
+    {
+      RES_SET_H_ERRNO (&_res, NETDB_INTERNAL);
+      return -1;
+    }
+  return res_nmkquery (&_res, op, dname, class, type,
+                       data, datalen, newrr_in, buf, buflen);
+}
+
 /* Create an OPT resource record.  Return the length of the final
    packet, or -1 on error.
 
@@ -262,3 +278,8 @@ __res_nopt (res_state statp, int n0, unsigned char *buf, int buflen,
 
   return cp - buf;
 }
+
+#if SHLIB_COMPAT (libresolv, GLIBC_2_0, GLIBC_2_2)
+# undef res_mkquery
+weak_alias (__res_mkquery, res_mkquery);
+#endif