mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
use qt_safe_open() and qt_safe_close() directly in QFSFileEngine
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
890185b958
commit
629c57c641
1 changed files with 3 additions and 11 deletions
|
@ -104,10 +104,7 @@ QFSFileEngine::~QFSFileEngine()
|
|||
Q_D(QFSFileEngine);
|
||||
if (d->closeFileHandle) {
|
||||
if (d->fd != -1) {
|
||||
int ret;
|
||||
do {
|
||||
ret = QT_CLOSE(d->fd);
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
qt_safe_close(d->fd);
|
||||
}
|
||||
}
|
||||
QList<uchar*> keys = d->maps.keys();
|
||||
|
@ -170,9 +167,7 @@ bool QFSFileEngine::open(QIODevice::OpenMode openMode)
|
|||
|
||||
// Try to open the file.
|
||||
QByteArray native = d->fileEntry.nativeFilePath();
|
||||
do {
|
||||
d->fd = QT_OPEN(native.constData(), flags, 0666);
|
||||
} while (d->fd == -1 && errno == EINTR);
|
||||
d->fd = qt_safe_open(native.constData(), flags, 0666);
|
||||
|
||||
// On failure, return and report the error.
|
||||
if (d->fd == -1) {
|
||||
|
@ -293,10 +288,7 @@ bool QFSFileEngine::close()
|
|||
|
||||
// Close the file if we created the handle.
|
||||
if (d->closeFileHandle) {
|
||||
int ret;
|
||||
do {
|
||||
ret = QT_CLOSE(d->fd);
|
||||
} while (ret == -1 && errno == EINTR);
|
||||
int ret = qt_safe_close(d->fd);
|
||||
|
||||
// We must reset these guys regardless; calling close again after a
|
||||
// failed close causes crashes on some systems.
|
||||
|
|
Loading…
Add table
Reference in a new issue