Kim F. Storm skrev:
Richard Stallman <address@hidden> writes:make-network-process calles gethostbyname, but never calls res_init. The problem, which appears is: if contents of /etc/resolv.conf was changed old dns servers are unavailable, gethostbyname still tries them, not new ones. So this bug is pretty much the same as (which has a patch). Would someone please DTRT about this, then ack? It needs to be fixed in Emacs 22.I don't know what to do about this. configure already has a check for res_init, but on my system (GNU/Linux), HAVE_RES_INIT is undefined, indicating that it doesn't exist. However, I believe that it does exist, but only if -lresolv is specified. So how can we fix configure to DTRT? a) Include -lresolv in the check for HAVE_RES_INIT. b) Include -lresolv in LIBS if and only if HAVE_RES_INIT is defined.
Should we not first try if res_init exists without any special libraries, and if that fails, check for -lresolv and try to find res_init again?Should we not first try if res_init exists without any special libraries, and if that fails, check for -lresolv and try to find res_init again?
But there seems to be some problem with that, comment in configure.in says: dnl This causes -lresolv to get used in subsequent tests, dnl which causes failures on some systems such as HPUX 9. dnl AC_CHECK_LIB(resolv, gethostbyname) But otherwise: AC_CHECK_FUNCS(res_init) if test "X$HAVE_RES_INIT" = X; then AC_SEARCH_LIBS(res_init, resolv, HAVE_RES_INIT=yes) fi Untested :-) Jan D.
If that is in place, it should be trivial to add #if HAVE_RES_INIT res_init(); #endif before all calls to gethostbyname and getaddrinfo.