projects
/
musl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
setjmp: optimize x86 longjmp epilogues
[musl]
/
src
/
stdio
/
__stdio_exit.c
diff --git
a/src/stdio/__stdio_exit.c
b/src/stdio/__stdio_exit.c
index
716e5f7
..
a5e42c6
100644
(file)
--- a/
src/stdio/__stdio_exit.c
+++ b/
src/stdio/__stdio_exit.c
@@
-9,17
+9,17
@@
static void close_file(FILE *f)
{
if (!f) return;
FFINALLOCK(f);
{
if (!f) return;
FFINALLOCK(f);
- if (f->wpos
>
f->wbase) f->write(f, 0, 0);
- if (f->rpos
<
f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
+ if (f->wpos
!=
f->wbase) f->write(f, 0, 0);
+ if (f->rpos
!=
f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
}
void __stdio_exit(void)
{
FILE *f;
}
void __stdio_exit(void)
{
FILE *f;
- OFLLOCK();
- for (f=libc.ofl_head; f; f=f->next) close_file(f);
+ for (f=*__ofl_lock(); f; f=f->next) close_file(f);
close_file(__stdin_used);
close_file(__stdout_used);
close_file(__stdin_used);
close_file(__stdout_used);
+ close_file(__stderr_used);
}
weak_alias(__stdio_exit, __stdio_exit_needed);
}
weak_alias(__stdio_exit, __stdio_exit_needed);