Re: [PATCH] copy.c: make copy_fd preserve meaningful errno

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] copy.c: make copy_fd preserve meaningful errno

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:05

Michael Haggerty [off-list ref] writes:
On 11/21/2014 10:14 AM, Michael Haggerty wrote:
quoted
Couldn't we save ourselves a lot of this "save_errno" boilerplate by
making error() and warning() preserve errno? [...]
Never mind; I see that Peff already submitted a patch to this effect.
My understanding of the conclusion of those four patches was that
only a single updated one is needed, and "moving save/restore inside
error()" did not have to survive.

  http://article.gmane.org/gmane.comp.version-control.git/259911

Re: [PATCH] copy.c: make copy_fd preserve meaningful errno

From: Jeff King <hidden>
Date: 2016-06-15 23:03:05

On Fri, Nov 21, 2014 at 09:48:19AM -0800, Junio C Hamano wrote:
Michael Haggerty [off-list ref] writes:
quoted
On 11/21/2014 10:14 AM, Michael Haggerty wrote:
quoted
Couldn't we save ourselves a lot of this "save_errno" boilerplate by
making error() and warning() preserve errno? [...]
Never mind; I see that Peff already submitted a patch to this effect.
My understanding of the conclusion of those four patches was that
only a single updated one is needed, and "moving save/restore inside
error()" did not have to survive.

  http://article.gmane.org/gmane.comp.version-control.git/259911
Yeah, the callsite I had intended ended up needing to save it across
more than just error(). And I think that is probably why we have never
done any errno-handling inside error() before (it is certainly not the
first time I thought of doing such a thing): real-world cases tend to be
a little more complicated.

That being said, if this copy() case is one that could benefit, I do not
have any problem with picking up (or just reusing the concept of) my
1/4 from that series. It probably does not _hurt_ anything, and if it
can help in even a few cases, it may be worth it.

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