git-log: detect dup and fdopen failure
This defines xdup() and xfdopen() in git-compat-util.h to give us error-catching variants of them without cluttering the code too much. Signed-off-by: Jim Meyering <jim@meyering.net> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
5483c71d7a
commit
f57882505e
@ -589,7 +589,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
|
||||
get_patch_ids(&rev, &ids, prefix);
|
||||
|
||||
if (!use_stdout)
|
||||
realstdout = fdopen(dup(1), "w");
|
||||
realstdout = xfdopen(xdup(1), "w");
|
||||
|
||||
prepare_revision_walk(&rev);
|
||||
while ((commit = get_revision(&rev)) != NULL) {
|
||||
|
||||
Reference in New Issue
Block a user