This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [patch] don't reset errno if no error occured
- From: Ulrich Drepper <drepper at redhat dot com>
- To: Paolo Carlini <paolo dot carlini at oracle dot com>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Mon, 12 Jul 2010 18:57:51 -0400 (EDT)
- Subject: Re: [patch] don't reset errno if no error occured
----- "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 â