This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Why this strange change?


>>>>> Ulrich Drepper writes:

Ulrich> hjl@lucon.org (H.J. Lu) writes:
>> Your change
>> 
>> 1999-06-17  Ulrich Drepper  <drepper@cygnus.com>
>> 
>> * nss/getXXbyYY_r.c: Return error code not -1. 
>> * nss/getXXent_r.c: Likewise.
>> 
>> breaks glibc and Linux very badly. Any codes like
>> 
>> if (getXXbyYY_r (......) < 0)
>> 
>> now don't work anymore since now getXXbyYY_r () returns errno which is
>> a positive number. Did you mean to return NAGATIVE of the error code?

Ulrich> Because this is the correct behaviour.  See POSIX.

Ulrich> User code must only test for != 0.

This might break X11 since /usr/include/X11/Xos_r.h has:
#  define _XGethostbyname(h,hp) \
  (bzero((char*)&(hp).hdata,sizeof((hp).hdata)),        \
   ((gethostbyname_r((h),&(hp).hent,&(hp).hdata) == -1) ? NULL : &(hp).hent))

Andreas
-- 
 Andreas Jaeger   aj@arthur.rhein-neckar.de    jaeger@informatik.uni-kl.de
  for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]