Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__stdio_exit.c: use normal file locking for now #363

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions libc-top-half/musl/src/stdio/__stdio_exit.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@ weak_alias(dummy_file, __stderr_used);
static void close_file(FILE *f)
{
if (!f) return;
#ifdef __wasilibc_unmodified_upstream
FFINALLOCK(f);
#else
FLOCK(f);
#endif
if (f->wpos != f->wbase) f->write(f, 0, 0);
if (f->rpos != f->rend) f->seek(f, f->rpos-f->rend, SEEK_CUR);
#ifndef __wasilibc_unmodified_upstream
FUNLOCK(f);
#endif
}

void __stdio_exit(void)
Expand Down