unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: "Kim F. Storm" <storm@cua.dk>
Cc: rms@gnu.org, emacs-devel@gnu.org
Subject: Re: make-network-process's gethostbyname usage
Date: Wed, 22 Aug 2007 13:32:08 +0200	[thread overview]
Message-ID: <46CC1EB8.6030404@swipnet.se> (raw)
In-Reply-To: <87veb8orkl.fsf@kfs-lx.testafd.dk>



Kim F. Storm skrev:
> Richard Stallman <rms@gnu.org> 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 http://bugs.debian.org/438680 (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?

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.
> 
> 

  reply	other threads:[~2007-08-22 11:32 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-20  8:56 make-network-process's gethostbyname usage Alexander Kotelnikov
2007-08-21  8:43 ` Kim F. Storm
2007-08-21  9:51   ` Alexander Kotelnikov
2007-08-21 14:46 ` Richard Stallman
2007-08-22  9:18   ` Kim F. Storm
2007-08-22 11:32     ` Jan Djärv [this message]
2007-08-23  0:45     ` Richard Stallman
2007-08-25 19:06     ` Chong Yidong
2007-08-27 11:09       ` Jan Djärv

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=46CC1EB8.6030404@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=emacs-devel@gnu.org \
    --cc=rms@gnu.org \
    --cc=storm@cua.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).