X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffileno.c;h=ba7f9391b1ec9baa6023f9a66f569b46a1f85ba2;hp=9ffb26d54d17754bc6b5bac465281a87a338564f;hb=c8cb6bcdf009e94c12c6e256b8e24a9bc5fdaf05;hpb=892cafff665b44d238e3b664f61ca38dd965cba6 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; }