From 0d48e774c6361d91dff9bd65785b1043ef20ea25 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 21 Sep 2014 15:18:17 +0200 Subject: [PATCH] Refactor some loops over EINTR QT_CLOSE is #defined to be qt_safe_close which already performs the EINTR loop. So there's no need of doing other loops (either by hand or by the EINTR_LOOP macro). Change-Id: Icca256124def5ab5d79c2ba101c6f889c85d19da Reviewed-by: Thiago Macieira --- src/corelib/io/qfsfileengine.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp index e198cd6d75..bed77678fa 100644 --- a/src/corelib/io/qfsfileengine.cpp +++ b/src/corelib/io/qfsfileengine.cpp @@ -170,10 +170,7 @@ QFSFileEngine::~QFSFileEngine() if (d->fh) { 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); } } QList keys = d->maps.keys(); @@ -378,7 +375,7 @@ bool QFSFileEnginePrivate::closeFdFh() ret = fclose(fh); } else { // Close unbuffered file. - EINTR_LOOP(ret, QT_CLOSE(fd)); + ret = QT_CLOSE(fd); } // We must reset these guys regardless; calling close again after a