anchor.diff:  gethostname()         -> db_get(hostname).
   
   res_update_conf() ->
  -    res_update(res_resolv_conf, res_resolv_conf_tm, res_resolv_conf_info,
  -	       set_resolv_conf_tm, fun set_resolv_conf/1).
  +    res_update(resolv_conf, res_resolv_conf_tm).
   
   res_update_hosts() ->
  -    res_update(res_hosts_file, res_hosts_file_tm, res_hosts_file_info,
  -	       set_hosts_file_tm, fun set_hosts_file/1).
  -
  -res_update(Tag, TagTm, TagInfo, TagSetTm, SetFun) ->
  +    res_update(hosts_file, res_hosts_file_tm).
  +
  +res_update(Option, TagTm) ->
       case db_get(TagTm) of
   	undefined -> ok;
  -	TM ->
  +	Tm ->
   	    case times() of
  -		Now when Now >= TM + ?RES_FILE_UPDATE_TM ->
  -		    case db_get(Tag) of
  -			undefined ->
  -			    SetFun("");
  -			"" ->
  -			    SetFun("");
  -			File ->
  -			    case erl_prim_loader:read_file_info(File) of
  -				{ok, Finfo0} ->
  -				    Finfo =
  -					Finfo0#file_info{access = undefined,
  -							 atime = undefined},
  -				    case db_get(TagInfo) of
  -					Finfo ->
  -					    call({TagSetTm, Now});
  -					_ ->
  -					    SetFun(File)
  -				    end;
  -				_ ->
  -				    call({TagSetTm, Now}),
  -				    error
  -			    end
  -		    end;
  +		Now when Now >= Tm + ?RES_FILE_UPDATE_TM ->
  +                    %% Enough time has passed - request server to update
  +                    res_option(Option, Tm);
   		_ -> ok
   	    end
       end.
  
positive.code: 	      end,
  	      From, State);
  	%%
  	{res_set, resolv_conf=Option, Fname} ->
  	    handle_set_file(
  	      Option, Fname, res_resolv_conf_tm, res_resolv_conf_info,
  	      fun (Bin) ->
  		      case inet_parse:resolv(
  			     Fname, {chars,Bin}) of
  			  {ok,Opts} ->
  			      Search =
  				  lists:foldl(
  
negative.code: 	    ets:insert(Db, {TagTm, TimeZero}),
  	    {reply,ok,State};
  	true ->
              %% Set file name and monitor, read content
  	    File = filename:flatten(Fname),
  	    ets:insert(Db, {res_optname(Option), File}),
              handle_update_file(
                undefined, File, TagTm, TagInfo, ParseFun, From, State);
  	false -> {reply,error,State}
      end.
  
  handle_set_file(ParseFun, File, Bin, From, State) ->
      case ParseFun(File, Bin) of
  	error ->
  	    {reply,error,State};
  	Opts ->
  	    handle_rc_list(Opts, From, State)
      end.
  
  handle_update_file(
    Finfo, File, TagTm, TagInfo, ParseFun, From, #state{db = Db} = State) ->
      %%
      %% Update file content if file has been updated
      %%
      case erl_prim_loader:read_file_info(File) of
          {ok, Finfo} ->
              %% No file update - we are done
              {reply, ok, State};
          {ok, Finfo_1} ->
              %% File updated - read content
              ets:insert(Db, {TagInfo, Finfo_1}),
              ets:insert(Db, {TagTm, times()}),
              Bin =
                  case erl_prim_loader:get_file(File) of
                      {ok, B, _} -> B;
                      _ -> <<>>
                  end,
              handle_set_file(ParseFun, File, Bin, From, State);
          _ ->
              %% No file - clear content and reset monitor
              ets:insert(Db, {TagInfo, undefined}),
              ets:insert(Db, {TagTm, times()}),
              handle_set_file(ParseFun, File, <<>>, From, State)
      end.
  
  %% Byname has lowercased names while Byaddr keep the name casing.
  