X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=blobdiff_plain;f=src%2Fstdio%2Ffwide.c;fp=src%2Fstdio%2Ffwide.c;h=48480685aa4b63a664ccc842548aa8f663c9b662;hp=f4da47f6da8ceca422dee4f6c4b1ad45af045ca5;hb=c8cb6bcdf009e94c12c6e256b8e24a9bc5fdaf05;hpb=892cafff665b44d238e3b664f61ca38dd965cba6 diff --git a/src/stdio/fwide.c b/src/stdio/fwide.c index f4da47f6..48480685 100644 --- a/src/stdio/fwide.c +++ b/src/stdio/fwide.c @@ -5,6 +5,8 @@ int fwide(FILE *f, int mode) { - if (!f->mode) f->mode = NORMALIZE(mode); - return f->mode; + FLOCK(f); + if (!f->mode) mode = f->mode = NORMALIZE(mode); + FUNLOCK(f); + return mode; }