From ec16fd0d010b40d2bde85a4167543bd3fa5823b0 Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Tue, 2 Nov 2010 13:27:58 +0100 Subject: abrtd: remove resolv.conf refresh code It is not needed anymore since we report to web using separate applications. And they reinitialize resolver on startup. Signed-off-by: Denys Vlasenko --- src/daemon/Daemon.cpp | 30 ------------------------------ 1 file changed, 30 deletions(-) (limited to 'src/daemon/Daemon.cpp') diff --git a/src/daemon/Daemon.cpp b/src/daemon/Daemon.cpp index 9e6965fb..d94f8a9b 100644 --- a/src/daemon/Daemon.cpp +++ b/src/daemon/Daemon.cpp @@ -22,7 +22,6 @@ #include #include #include -#include /* res_init */ #include #include #include /* ioctl(FIONREAD) */ @@ -745,8 +744,6 @@ static gboolean handle_inotify_cb(GIOChannel *gio, GIOCondition condition, gpoin static void run_main_loop(GMainLoop* loop) { GMainContext *context = g_main_loop_get_context(loop); - time_t old_time = 0; - time_t dns_conf_hash = 0; int fds_size = 0; GPollFD *fds = NULL; @@ -776,33 +773,6 @@ static void run_main_loop(GMainLoop* loop) if (s_timeout) alarm(0); - /* res_init() makes glibc reread /etc/resolv.conf. - * I'd think libc should be clever enough to do it itself - * at every name resolution attempt, but no... - * We need to guess ourself whether we want to do it. - */ - time_t now = time(NULL) >> 2; - if (old_time != now) /* check once in 4 seconds */ - { - old_time = now; - - time_t hash = 0; - struct stat sb; - if (stat("/etc/resolv.conf", &sb) == 0) - hash = sb.st_mtime; - if (stat("/etc/host.conf", &sb) == 0) - hash += sb.st_mtime; - if (stat("/etc/hosts", &sb) == 0) - hash += sb.st_mtime; - if (stat("/etc/nsswitch.conf", &sb) == 0) - hash += sb.st_mtime; - if (dns_conf_hash != hash) - { - dns_conf_hash = hash; - res_init(); - } - } - some_ready = g_main_context_check(context, max_priority, fds, nfds); if (some_ready) g_main_context_dispatch(context); -- cgit