summaryrefslogtreecommitdiffstats
path: root/src/corelib/io/qfsfileengine.cpp
diff options
context:
space:
mode:
authorGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-09-29 13:37:46 +0200
committerGabriel de Dietrich <gabriel.dedietrich@digia.com>2014-09-29 13:38:11 +0200
commit8ab25620d3df25c43011ae982f4614639578afb3 (patch)
treee94d53c6b7d231ca18f0787a0c09bec07d163a67 /src/corelib/io/qfsfileengine.cpp
parentdfe853bff90444edf92a993e391df853780c9e8d (diff)
parent5222abfdf5f034bad12bbe12312a4149550495b7 (diff)
Merge remote-tracking branch 'origin/5.3' into 5.4
Conflicts: src/network/socket/qnativesocketengine_unix.cpp src/widgets/kernel/qwidget_qpa.cpp Change-Id: I6f1aa320d5ca66cd92d601a95885aeaab0abb191
Diffstat (limited to 'src/corelib/io/qfsfileengine.cpp')
-rw-r--r--src/corelib/io/qfsfileengine.cpp27
1 files changed, 10 insertions, 17 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 674742fbf6..42250b629d 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -160,15 +160,9 @@ QFSFileEngine::~QFSFileEngine()
Q_D(QFSFileEngine);
if (d->closeFileHandle) {
if (d->fh) {
- int ret;
- do {
- ret = fclose(d->fh);
- } while (ret == EOF && errno == EINTR);
+ fclose(d->fh);
} else if (d->fd != -1) {
- int ret;
- do {
- ret = QT_CLOSE(d->fd);
- } while (ret == -1 && errno == EINTR);
+ QT_CLOSE(d->fd);
}
}
d->unmapAll();
@@ -365,15 +359,14 @@ bool QFSFileEnginePrivate::closeFdFh()
// Close the file if we created the handle.
if (closeFileHandle) {
int ret;
- do {
- if (fh) {
- // Close buffered file.
- ret = fclose(fh) != 0 ? -1 : 0;
- } else {
- // Close unbuffered file.
- ret = QT_CLOSE(fd);
- }
- } while (ret == -1 && errno == EINTR);
+
+ if (fh) {
+ // Close buffered file.
+ ret = fclose(fh);
+ } else {
+ // Close unbuffered file.
+ ret = QT_CLOSE(fd);
+ }
// We must reset these guys regardless; calling close again after a
// failed close causes crashes on some systems.