projects
/
musl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
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
26bc37e
..
9481470
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);