query-dns was renamed to dns-query; check for both.

This commit is contained in:
Magnus Henoch 2009-02-19 00:15:14 +00:00 committed by Kirill A. Korinskiy
parent 16d3ae978d
commit 27bdf14195
1 changed files with 4 additions and 1 deletions

5
srv.el
View File

@ -46,7 +46,10 @@ of the list. The list is empty if no SRV records were found."
(error "No dns.el available"))
(unless (assq 'SRV dns-query-types)
(error "dns.el doesn't support SRV lookups"))
(let* ((result (query-dns target 'SRV t))
;; `dns-query' used to be `query-dns'. Try both names for now.
(let* ((result (if (fboundp 'query-dns)
(query-dns target 'SRV t)
(dns-query target 'SRV t)))
(answers (mapcar #'(lambda (a)
(cadr (assq 'data a)))
(cadr (assq 'answers result))))