Thread (104 messages) 104 messages, 3 authors, 2016-06-15
STALE3644d
Revisions (2)
  1. v2 [diff vs current]
  2. v3 current

[PATCH v3 04/34] mailinfo: explicitly close file handle to the patch output

From: Junio C Hamano <hidden>
Date: 2016-06-15 23:06:54
Subsystem: the rest · Maintainer: Linus Torvalds

This does not make a difference within the context of "git mailinfo"
that runs once and exits, as flushing and closing would happen upon
process termination.  It however will matter when we eventually make
it callable as an API function.

Besides, cleaning after yourself once you are done is a good hygiene.

Signed-off-by: Junio C Hamano <redacted>
---
 builtin/mailinfo.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/builtin/mailinfo.c b/builtin/mailinfo.c
index 1566c19..73be47c 100644
--- a/builtin/mailinfo.c
+++ b/builtin/mailinfo.c
@@ -999,6 +999,8 @@ static int mailinfo(FILE *in, FILE *out, const char *msg, const char *patch)
 		check_header(&line, p_hdr_data, 1);
 
 	handle_body();
+	fclose(patchfile);
+
 	handle_info();
 
 	return 0;
-- 
2.6.2-383-g144b2e6
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help