From 0377ecdfb001c4dc1b507ebc06211f29b19048e3 Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Tue, 2 Feb 2010 12:45:43 +0100 Subject: inet: delayed/avoided read of /etc/resolv.conf and /etc/hosts The 'file' and 'dns' lookup methods configuration files are now read and parsed at the time of the first lookup instead of at boot time when per default none of these lookup methods are used. --- lib/kernel/src/inet_config.erl | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'lib/kernel/src/inet_config.erl') diff --git a/lib/kernel/src/inet_config.erl b/lib/kernel/src/inet_config.erl index b5317f72f5..cba38359e1 100644 --- a/lib/kernel/src/inet_config.erl +++ b/lib/kernel/src/inet_config.erl @@ -130,21 +130,25 @@ init() -> {unix,_} -> %% The Etc variable enables us to run tests with other %% configuration files than the normal ones - Etc = case os:getenv("ERL_INET_ETC_DIR") of - false -> ?DEFAULT_ETC; - _EtcDir -> - _EtcDir - end, + Etc = + case os:getenv("ERL_INET_ETC_DIR") of + false -> + ?DEFAULT_ETC; + _EtcDir -> + _EtcDir + end, case inet_db:res_option(resolv_conf) of undefined -> - inet_db:set_resolv_conf(filename:join(Etc, - ?DEFAULT_RESOLV)); + inet_db:res_option( + resolv_conf_name, + filename:join(Etc, ?DEFAULT_RESOLV)); _ -> ok end, case inet_db:res_option(hosts_file) of undefined -> - inet_db:set_hosts_file(filename:join(Etc, - ?DEFAULT_HOSTS)); + inet_db:res_option( + hosts_file_name, + filename:join(Etc, ?DEFAULT_HOSTS)); _ -> ok end; _ -> ok -- cgit v1.2.3