diff options
Diffstat (limited to 'newlib/libc/stdio/fgetpos.c')
-rw-r--r-- | newlib/libc/stdio/fgetpos.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fgetpos.c b/newlib/libc/stdio/fgetpos.c index 21a63789d..a89d88f03 100644 --- a/newlib/libc/stdio/fgetpos.c +++ b/newlib/libc/stdio/fgetpos.c @@ -81,12 +81,15 @@ _DEFUN(_fgetpos_r, (ptr, fp, pos), FILE * fp _AND _fpos_t * pos) { + _flockfile (fp); *pos = _ftell_r (ptr, fp); if (*pos != -1) { + _funlockfile (fp); return 0; } + _funlockfile (fp); return 1; } |