aboutsummaryrefslogtreecommitdiffstats
path: root/lib/kernel/src/inet_config.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2010-02-02 12:45:43 +0100
committerBjörn Gustavsson <[email protected]>2010-02-09 13:41:42 +0100
commit0377ecdfb001c4dc1b507ebc06211f29b19048e3 (patch)
tree88ede7d9e52ab9971834bcfd57155c73717a9236 /lib/kernel/src/inet_config.erl
parenta53dfdc8d1656faf4b8fc7b41d036f25684d71fe (diff)
downloadotp-0377ecdfb001c4dc1b507ebc06211f29b19048e3.tar.gz
otp-0377ecdfb001c4dc1b507ebc06211f29b19048e3.tar.bz2
otp-0377ecdfb001c4dc1b507ebc06211f29b19048e3.zip
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.
Diffstat (limited to 'lib/kernel/src/inet_config.erl')
-rw-r--r--lib/kernel/src/inet_config.erl22
1 files changed, 13 insertions, 9 deletions
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