diff options
Diffstat (limited to 'newlib/libc/stdio64')
-rw-r--r-- | newlib/libc/stdio64/fgetpos64.c | 3 | ||||
-rw-r--r-- | newlib/libc/stdio64/freopen64.c | 4 | ||||
-rw-r--r-- | newlib/libc/stdio64/fseeko64.c | 6 | ||||
-rw-r--r-- | newlib/libc/stdio64/ftello64.c | 6 |
4 files changed, 8 insertions, 11 deletions
diff --git a/newlib/libc/stdio64/fgetpos64.c b/newlib/libc/stdio64/fgetpos64.c index 5f8c1c3ab..36f7ec90b 100644 --- a/newlib/libc/stdio64/fgetpos64.c +++ b/newlib/libc/stdio64/fgetpos64.c @@ -60,15 +60,12 @@ _DEFUN (_fgetpos64_r, (ptr, fp, pos), FILE * fp _AND _fpos64_t * pos) { - _flockfile(fp); *pos = (_fpos64_t)_ftello64_r (ptr, fp); if (*pos != -1) { - _funlockfile(fp); return 0; } - _funlockfile(fp); return 1; } diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index fc846595e..b8b7974e5 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -91,9 +91,9 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), __sfp_lock_acquire (); - _flockfile(fp); + CHECK_INIT (ptr); - CHECK_INIT (fp); + _flockfile(fp); if ((flags = __sflags (ptr, mode, &oflags)) == 0) { diff --git a/newlib/libc/stdio64/fseeko64.c b/newlib/libc/stdio64/fseeko64.c index 312883072..edd764009 100644 --- a/newlib/libc/stdio64/fseeko64.c +++ b/newlib/libc/stdio64/fseeko64.c @@ -111,11 +111,11 @@ _DEFUN (_fseeko64_r, (ptr, fp, offset, whence), struct stat64 st; int havepos; - _flockfile(fp); - /* Make sure stdio is set up. */ - CHECK_INIT (fp); + CHECK_INIT (ptr); + + _flockfile(fp); curoff = fp->_offset; diff --git a/newlib/libc/stdio64/ftello64.c b/newlib/libc/stdio64/ftello64.c index aaf0f023e..ef3317561 100644 --- a/newlib/libc/stdio64/ftello64.c +++ b/newlib/libc/stdio64/ftello64.c @@ -91,11 +91,11 @@ _DEFUN (_ftello64_r, (ptr, fp), { _fpos64_t pos; - _flockfile(fp); - /* Ensure stdio is set up. */ - CHECK_INIT (fp); + CHECK_INIT (ptr); + + _flockfile(fp); if (fp->_seek64 == NULL) { |