summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfile.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/io/qfile.cpp')
-rw-r--r--src/corelib/io/qfile.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/io/qfile.cpp b/src/corelib/io/qfile.cpp
index 64d8ef3..4dd6185 100644
--- a/src/corelib/io/qfile.cpp
+++ b/src/corelib/io/qfile.cpp
@@ -1120,8 +1120,13 @@ bool QFile::open(int fd, OpenMode mode)
}
if(d->openExternalFile(mode, fd)) {
QIODevice::open(mode);
- if (mode & Append)
+ if (mode & Append) {
seek(size());
+ } else {
+ qint64 pos = (qint64)QT_LSEEK(fd, QT_OFF_T(0), SEEK_CUR);
+ if (pos != -1)
+ seek(pos);
+ }
return true;
}
return false;