@@ -58,36 +58,6 @@ init() ->
58
58
OsType = os :type (),
59
59
do_load_resolv (OsType , erl_dist_mode ()),
60
60
61
- case OsType of
62
- {unix ,Type } ->
63
- if Type =:= linux ->
64
- % % It may be the case that the domain name was not set
65
- % % because the hostname was short. But NOW we can look it
66
- % % up and get the long name and the domain name from it.
67
-
68
- % % FIXME: The second call to set_hostname will insert
69
- % % a duplicate entry in the search list.
70
-
71
- case inet_db :res_option (domain ) of
72
- " " ->
73
- case inet :gethostbyname (inet_db :gethostname ()) of
74
- {ok ,# hostent {h_name = []}} ->
75
- ok ;
76
- {ok ,# hostent {h_name = HostName }} ->
77
- set_hostname ({ok ,HostName });
78
- _ ->
79
- ok
80
- end ;
81
- _ ->
82
- ok
83
- end ;
84
- true -> ok
85
- end ,
86
- add_dns_lookup (inet_db :res_option (lookup ));
87
- _ ->
88
- ok
89
- end ,
90
-
91
61
% % Read inetrc file, if it exists.
92
62
{RcFile ,CfgFiles ,CfgList } = read_rc (),
93
63
@@ -133,6 +103,36 @@ init() ->
133
103
_ -> ok
134
104
end ;
135
105
_ -> ok
106
+ end ,
107
+
108
+ case OsType of
109
+ {unix ,Type } ->
110
+ if Type =:= linux ->
111
+ % % It may be the case that the domain name was not set
112
+ % % because the hostname was short. But NOW we can look it
113
+ % % up and get the long name and the domain name from it.
114
+
115
+ % % FIXME: The second call to set_hostname will insert
116
+ % % a duplicate entry in the search list.
117
+
118
+ case inet_db :res_option (domain ) of
119
+ " " ->
120
+ case inet :gethostbyname (inet_db :gethostname ()) of
121
+ {ok ,# hostent {h_name = []}} ->
122
+ ok ;
123
+ {ok ,# hostent {h_name = HostName }} ->
124
+ set_hostname ({ok ,HostName });
125
+ _ ->
126
+ ok
127
+ end ;
128
+ _ ->
129
+ ok
130
+ end ;
131
+ true -> ok
132
+ end ,
133
+ add_dns_lookup (inet_db :res_option (lookup ));
134
+ _ ->
135
+ ok
136
136
end .
137
137
138
138
0 commit comments