Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] Don't fflush(stdout) when it's not helpful

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:43:19

Linus Torvalds [off-list ref] writes:
quoted
I was planning to push this out to 'master' this weekend.
I think that code is fine, but switching the order around could probably 
make it less likely that stdio loses the errno for us. 

So doing the last part in a different order, and making it say

	/* Check for ENOSPC and EIO errors.. */
	if (fflush(stdout))
		die("write failure on standard output: %s", strerror(errno));
	if (ferror(stdout))
		die("unknown write failure on standard output");
	if (fclose(stdout))
		die("close failed on standard output: %s", strerror(errno));
	return 0;

may recover at least non-transient errors.
That makes sense, to a certain degree, given that we do not
check every printf().  I'll forge your signature as usual ;-)

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