summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenys Vlasenko <dvlasenk@redhat.com>2010-11-02 13:27:58 +0100
committerDenys Vlasenko <dvlasenk@redhat.com>2010-11-02 13:27:58 +0100
commitec16fd0d010b40d2bde85a4167543bd3fa5823b0 (patch)
treef70934d5a2fa68da658d5dfa74921fc467331481 /src
parent3c8781e79c38961c47fc0683a4eaf665b835153c (diff)
downloadabrt-ec16fd0d010b40d2bde85a4167543bd3fa5823b0.tar.gz
abrt-ec16fd0d010b40d2bde85a4167543bd3fa5823b0.tar.xz
abrt-ec16fd0d010b40d2bde85a4167543bd3fa5823b0.zip
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 <dvlasenk@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/daemon/Daemon.cpp30
1 files changed, 0 insertions, 30 deletions
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 <sys/un.h>
#include <syslog.h>
#include <pthread.h>
-#include <resolv.h> /* res_init */
#include <string>
#include <sys/inotify.h>
#include <sys/ioctl.h> /* 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);