Re: getdomainname: fix several problems

2010-12-01 Thread Bruno Haible
Paul Eggert wrote: > Thanks, that looks good, except for a couple of minor details: Thanks again for the review. I've pushed it now, with tiny modifications. Bruno

Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
On 11/28/2010 06:43 PM, Bruno Haible wrote: > The declaration of sysinfo on all three platforms (Solaris, IRIX, OSF/1) is: > int sysinfo(int, char *, long); Ah, sorry, I was relying on the Solaris man page, which says it returns "long". http://docs.sun.com/app/docs/doc/816-5167/sysinfo-2 Since

Re: getdomainname: fix several problems

2010-11-28 Thread Bruno Haible
Hi Paul, Thanks for the review. > > + if (len > INT_MAX) > > +len = INT_MAX; > > + ret = sysinfo (SI_SRPC_DOMAIN, name, len); > > 'ret' should be of type long int, not int, and > the INT_MAX should be LONG_MAX (twice). The declaration of sysinfo on all three platforms (Solaris, IRIX, OSF/

Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
Thanks, that looks good, except for a couple of minor details: > + int ret; > + > + if (len > INT_MAX) > +len = INT_MAX; > + ret = sysinfo (SI_SRPC_DOMAIN, name, len); 'ret' should be of type long int, not int, and the INT_MAX should be LONG_MAX (twice). >dnl Where is getdomainname()

Re: getdomainname: fix several problems

2010-11-28 Thread Bruno Haible
Hi Paul, > who needs getdomainname and why? If the caller wants the DNS domain, > they could well be barking up the wrong tree here. It's a glibc function, and some programs use it. There's a big warning in our unistd.in.h that this function is not related to the DNS domain. >

Re: getdomainname: fix several problems

2010-11-28 Thread Simon Josefsson
Bruno Haible writes: > Tested with a unit test on glibc, MacOS X 10.5, AIX 5.1, OSF/1 5.1, Solaris > 10, > mingw. OK to commit? Thank you! Seems fine to me. Paul Eggert writes: > On 11/28/2010 08:56 AM, Bruno Haible wrote: >> So what the gnulib replacement was doing, was to return a >> dumm

Re: getdomainname: fix several problems

2010-11-28 Thread Paul Eggert
On 11/28/2010 08:56 AM, Bruno Haible wrote: > So what the gnulib replacement was doing, was to return a > dummy string instead of calling the system's function. It is better > to call the system's function. says that libnsl's g