Re: [PATCH] git-log: detect dup and fdopen failure
- Date: Wed, 27 Jun 2007 09:49:39 -0700 (PDT)
- From: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
- Subject: Re: [PATCH] git-log: detect dup and fdopen failure
On Wed, 27 Jun 2007, Jim Meyering wrote:
>
> Subject: [PATCH] git-log: detect dup and fdopen failure
> git-compat-util.h (xdup, xfdopen): Define functions.
>
> Signed-off-by: Jim Meyering <jim@xxxxxxxxxxxx>
Acked-by: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
That said, the whole "prepend 'x' to the function name" thing is obviously
how git does things, but maybe it would be more readable in the long term
to make the prefix be 'safe_' instead of 'x', or something like that?
The 'x' thing is the fairly traditional thing to do for malloc(), and
that's where it comes from, of course. In git (and other places: google
code shows that other projects have ended up with the same kind of things,
with busybox being one example I found), it then got extended to
xread/xwrite, but now it's getting extended so much that I'd worry a bit
that in the long run the easy-to-miss 'x' part really would be better off
written out a bit more.
No really strong opinion, just throwing it out for comment.
It was brought on by the fact that I mentally parsed "xfdopen()" as "xf" +
"dopen" for some reason (but maybe that's just me).
Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html