X-Git-Url: https://git.tokkee.org/?p=sysdb.git;a=blobdiff_plain;f=src%2Fplugins%2Fcname%2Fdns.c;h=0b17d963af691519faa260d628004fc08e41b857;hp=d989e52bc4841fb4317317c86d92a3515f6966ae;hb=aa416a57d8b302fce242fcb5e73c97531536899f;hpb=b3266fde4664f391ad1621d121e7b2c6024d5d9e diff --git a/src/plugins/cname/dns.c b/src/plugins/cname/dns.c index d989e52..0b17d96 100644 --- a/src/plugins/cname/dns.c +++ b/src/plugins/cname/dns.c @@ -25,9 +25,13 @@ * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#if HAVE_CONFIG_H +# include "config.h" +#endif /* HAVE_CONFIG_H */ + #include "sysdb.h" #include "core/plugin.h" -#include "core/error.h" +#include "utils/error.h" #include #include @@ -64,7 +68,7 @@ sdb_dns_cname(const char *name, err = getaddrinfo(name, /* service = */ NULL, &hints, &ret); if (err) { /* XXX: what to do about EAI_AGAIN? */ - sdb_plugin_logf(SDB_LOG_ERR, "cname::dns: Failed to resolve '%s': %s", + sdb_log(SDB_LOG_ERR, "cname::dns: Failed to resolve '%s': %s", name, gai_strerror(err)); return NULL; } @@ -80,7 +84,6 @@ sdb_dns_cname(const char *name, int sdb_module_init(sdb_plugin_info_t *info) { - sdb_plugin_set_info(info, SDB_PLUGIN_INFO_NAME, "cname::dns"); sdb_plugin_set_info(info, SDB_PLUGIN_INFO_DESC, "canonicalize hostnames by querying DNS"); sdb_plugin_set_info(info, SDB_PLUGIN_INFO_COPYRIGHT, @@ -89,7 +92,7 @@ sdb_module_init(sdb_plugin_info_t *info) sdb_plugin_set_info(info, SDB_PLUGIN_INFO_VERSION, SDB_VERSION); sdb_plugin_set_info(info, SDB_PLUGIN_INFO_PLUGIN_VERSION, SDB_VERSION); - sdb_plugin_register_cname("cname::dns", sdb_dns_cname, NULL); + sdb_plugin_register_cname("main", sdb_dns_cname, NULL); return 0; } /* sdb_module_init */