Thread (8 messages) flat view 8 messages, 3 authors, 2017-02-17

Re: [PATCH] tempfile: avoid "ferror | fclose" trick

From: Michael Haggerty <hidden>
Date: 2017-02-17 10:42:37

Possibly related (same subject, not in this thread)

On 02/17/2017 09:07 AM, Jeff King wrote:
[...]
That's similar to what I wrote earlier, but if we don't mind overwriting
errno unconditionally, I think just:

  errno = EIO; /* covers ferror(), overwritten by failing fclose() */
  err |= ferror(fp);
  err |= fclose(fp);

does the same thing.
True; I'd forgotten the convention that non-failing functions are
allowed to change errno. Your solution is obviously simpler and faster.

Michael
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help