diff options
Diffstat (limited to 'src/corelib/io/qfile.cpp')
| -rw-r--r-- | src/corelib/io/qfile.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp index 6249d54f7de..c19cb927150 100644 --- a/src/corelib/io/qfile.cpp +++ b/src/corelib/io/qfile.cpp @@ -956,7 +956,9 @@ bool QFile::open(FILE *fh, OpenMode mode, FileHandleFlags handleFlags) qWarning("QFile::open: File access not specified"); return false; } - if (d->openExternalFile(mode, fh, handleFlags)) { + + // QIODevice provides the buffering, so request unbuffered file engines + if (d->openExternalFile(mode | Unbuffered, fh, handleFlags)) { QIODevice::open(mode); if (!(mode & Append) && !isSequential()) { qint64 pos = (qint64)QT_FTELL(fh); @@ -1012,7 +1014,9 @@ bool QFile::open(int fd, OpenMode mode, FileHandleFlags handleFlags) qWarning("QFile::open: File access not specified"); return false; } - if (d->openExternalFile(mode, fd, handleFlags)) { + + // QIODevice provides the buffering, so request unbuffered file engines + if (d->openExternalFile(mode | Unbuffered, fd, handleFlags)) { QIODevice::open(mode); if (!(mode & Append) && !isSequential()) { qint64 pos = (qint64)QT_LSEEK(fd, QT_OFF_T(0), SEEK_CUR); |
