X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffileno.c;h=ba7f9391b1ec9baa6023f9a66f569b46a1f85ba2;hp=9ffb26d54d17754bc6b5bac465281a87a338564f;hb=HEAD;hpb=0b44a0315b47dd8eced9f3b7f31580cf14bbfc01 diff --git a/src/stdio/fileno.c b/src/stdio/fileno.c index 9ffb26d5..ba7f9391 100644 --- a/src/stdio/fileno.c +++ b/src/stdio/fileno.c @@ -2,6 +2,11 @@ int fileno(FILE *f) { + /* f->fd never changes, but the lock must be obtained and released + * anyway since this function cannot return while another thread + * holds the lock. */ + FLOCK(f); + FUNLOCK(f); return f->fd; }