This is the mail archive of the libc-hacker@sources.redhat.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: elm 2.5.3 and glibc 2.1.93


On Fri, Sep 22, 2000 at 09:39:54AM -0700, H . J . Lu wrote:
> 
> >From here, I conclude "The glibc functions do not change `errno' when
> they succeed." By not saving/restoring errno, we have changed
> documented glibc behavior. We should be consistent on it.
> 

One possible glibc code may look like:

  if (foo (....) == -1)
    {
      if (bar (...) == -1)
        exit (1);

     switch (errno)
       {
       case xxx:
         break;
       case xxx:
         break;
       default:
         /* Ooops, unknown error. Quit. */
         exit (2);
       }
    }

Since bar () may change errno now, this perfect valid glibc code may
not work right now. I will guess this code will work on most of other
Unixes.


H.J.

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