Re: canon-host errors

2005-09-13 Thread Derek Price
Jim Meyering wrote: >Derek Price <[EMAIL PROTECTED]> wrote: > > >>I've installed the attached patch. It is almost identical to my >>previous one, with a few extra portability and typo fixes. >> >>2005-09-12 Derek Price <[EMAIL PROTECTED]> >> >>* modules/canon-host: Add canon-host.h. Depe

Re: canon-host errors

2005-09-13 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > I've installed the attached patch. It is almost identical to my > previous one, with a few extra portability and typo fixes. > > 2005-09-12 Derek Price <[EMAIL PROTECTED]> > > * modules/canon-host: Add canon-host.h. Depend on getaddrinfo. Make >

Re: canon-host errors

2005-09-12 Thread Derek Price
I've installed the attached patch. It is almost identical to my previous one, with a few extra portability and typo fixes. 2005-09-12 Derek Price <[EMAIL PROTECTED]> * modules/canon-host: Add canon-host.h. Depend on getaddrinfo. Make LGPL. * modules/getaddrinfo: Add link to openg

AC 2.59 incompatibility in getaddrinfo.h (was Re: canon-host errors)

2005-09-08 Thread Derek Price
Is there any reason I can't just assume gl_GETADDRINFO ran and config.h was included before getaddrinfo.h? The following test is always coming up false on platforms without getaddrinfo (as of AC 2.59, at least, AC_CHECK_FUNCS via AC_REPLACE_FUNCS leaves HAVE_GETADDRINFO undefined when it is not fo

Re: canon-host errors

2005-09-06 Thread Simon Josefsson
Derek Price <[EMAIL PROTECTED]> writes: > * modules/getaddrinfo: Add link to opengroup spec. Depend on strdup. > Make canon-host require getaddrinfo. > * m4/getaddrinfo.m4 (gl_GETADDRINFO): Compile gai_strerror when needed. > Return usable errors from canon-host. > * lib/getad

Re: canon-host errors

2005-09-05 Thread Derek Price
Jim Meyering wrote: >>suitable for gai_strerror. I'll have to extend lib/getaddrinfo.c a >>little to fill in ai_canonhost and add the gai_strerror function. Would >>that be acceptable? >> >> > >Good idea. More than `acceptable' :-) > > Patch attached. I decided the reverse-lookup which

Re: canon-host errors

2005-09-04 Thread Derek Price
Hrm. The POSIX getaddrinfo specification is pretty clear about *not* resolving a name for ai_canonname if name is in IP dot notation, yet sometimes the canon-host implemetation does a reverse-lookup to get a canonical name (for some odd condition where gethostbyname fills in the h_name field of th

Re: canon-host errors

2005-09-04 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > Derek Price wrote: > >>Hrm. Why isn't canon-host dependant on getaddrinfo? It would >> > > The alternative is that the ch_strerror_r function I've been working on > would need to handle ENOMEM too, which introduces a dependency on > strerror_r... I almos

Re: canon-host errors

2005-09-04 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > Hrm. Why isn't canon-host dependant on getaddrinfo? It would simplify > the canon-host code so much that it would probably be all right to LGPL > it. It would also mean that canon-host could just return error codes > suitable for gai_strerror. I'll have

Re: canon-host errors

2005-09-04 Thread Derek Price
Derek Price wrote: >This was about what I was thinking, though I was going to combine >canon_host & canon_host_r in the canon-host module and let the caller >decide what to call. How about this API: > > Hrm. Why isn't canon-host dependant on getaddrinfo? It would simplify the canon-host code

Re: canon-host errors

2005-09-04 Thread Derek Price
Derek Price wrote: >Hrm. Why isn't canon-host dependant on getaddrinfo? It would > The alternative is that the ch_strerror_r function I've been working on would need to handle ENOMEM too, which introduces a dependency on strerror_r... I almost have the previously discussed canon-host code don

Re: canon-host errors

2005-09-04 Thread Derek Price
Jim Meyering wrote: >I don't thinks it's worthwhile to pander to single-threaded >applications for something like this. > > In this case, pandering isn't very complicated, so I think I'll do it. Besides, this way, if anyone else is using the canon-host module, they won't need to update callers

Re: canon-host errors

2005-09-04 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > Okay. Will do. Should I ignore single-threaded apps entirely, keep the > error data in a global to simplify for single-threaded apps on NULL, or > break the functions into canon_host, canon_host_r, strcherror, & > strcherror_r? I don't thinks it's worthwh

Re: canon-host errors

2005-09-04 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > Hrm. A new enum parameter would mean duplicating a bunch of potential > POSIX error codes from the other three functions. How about if I leave > the enum parameter somewhat opaque and provide a canon_host_error > (perhaps strcherror is a better name) to in

Re: canon-host errors

2005-09-04 Thread Derek Price
Jim Meyering wrote: >I like your idea of keeping them separate. >How about passing either NULL or the address of a struct >containing a member for each error indicator? > > Okay. Will do. Should I ignore single-threaded apps entirely, keep the error data in a global to simplify for single-thr

Re: canon-host errors

2005-09-04 Thread Derek Price
Jim Meyering wrote: >Personally, I don't mind if you add the code to emit warnings now, >as long as you agree to adjust the API later, (e.g., to add >a new enum parameter describing the error) if anyone complains. >Of course, it'd be better to keep it library-safe. > > Hrm. A new enum paramete

Re: canon-host errors

2005-09-04 Thread Jim Meyering
Derek Price <[EMAIL PROTECTED]> wrote: > Would anyone object to a patch that caused canon-host to output warnings > via error (0, ...) when one of the functions it calls fails? > getaddrinfo returns errors differently than gethostbyname and > gethostbyaddr, making outputting a useful error message

canon-host errors

2005-09-04 Thread Derek Price
Hi all, Would anyone object to a patch that caused canon-host to output warnings via error (0, ...) when one of the functions it calls fails? getaddrinfo returns errors differently than gethostbyname and gethostbyaddr, making outputting a useful error message upon seeing a simple NULL return from