projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9be201
)
fix undefined call order in fclose, possible lost output depending on compiler
author
Rich Felker
<dalias@aerifal.cx>
Mon, 2 May 2011 02:59:14 +0000
(22:59 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Mon, 2 May 2011 02:59:14 +0000
(22:59 -0400)
pcc turned up this bug by calling f->close(f) before fflush(f),
resulting in lost output and error on flush.
src/stdio/fclose.c
patch
|
blob
|
history
diff --git
a/src/stdio/fclose.c
b/src/stdio/fclose.c
index 26bc37e8c3dbb82a0292f0f67a8b823b56158fc5..9481470de12777352763f15e5c0b5834b832466a 100644
(file)
--- a/
src/stdio/fclose.c
+++ b/
src/stdio/fclose.c
@@
-13,7
+13,7
@@
int fclose(FILE *f)
OFLUNLOCK();
}
- r =
fflush(f) | f->close(f
);
+ r =
-(fflush(f) || f->close(f)
);
if (!perm) free(f);