[patch] don't reset errno if no error occured

Ulrich Drepper drepper@redhat.com
Mon Jul 12 22:57:00 GMT 2010


----- "Paolo Carlini" <paolo.carlini@oracle.com> wrote:
>         errno = 0;
>         do
>           __err = fclose(_M_cfile);
>         while (__err && errno == EINTR);

This code is fine even though the assignment is unnecessary in case the implementation is correct.  As I said, if code breaks because of this extra assignment the caller is broken.

-- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖



More information about the Libstdc++ mailing list