diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2018-10-20 23:00:27 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2018-10-20 23:19:30 +0000 |
commit | 9ef793ba9539b4eddb7893c0df9be6e211d9984f (patch) | |
tree | 7b9374b8dcc8cbbc3b92636b2029f1b55c5e3194 /src/corelib | |
parent | e631e900fd0cd7467b1dccb5fa401afdcd1e41a8 (diff) | |
parent | 7a252ac46780b6145084d8d5ca0549b2de3639cc (diff) |
Merge "Merge remote-tracking branch 'origin/5.11' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/global/minimum-linux_p.h | 7 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 46 | ||||
-rw-r--r-- | src/corelib/kernel/qwineventnotifier.cpp | 8 |
3 files changed, 21 insertions, 40 deletions
diff --git a/src/corelib/global/minimum-linux_p.h b/src/corelib/global/minimum-linux_p.h index bad2488b4d..9c074e13ba 100644 --- a/src/corelib/global/minimum-linux_p.h +++ b/src/corelib/global/minimum-linux_p.h @@ -75,9 +75,14 @@ QT_BEGIN_NAMESPACE * - accept4 2.6.28 * - renameat2 3.16 QT_CONFIG(renameat2) * - getrandom 3.17 QT_CONFIG(getentropy) + * - statx 4.11 QT_CONFIG(statx) */ -#if QT_CONFIG(getentropy) +#if QT_CONFIG(statx) +# define MINLINUX_MAJOR 4 +# define MINLINUX_MINOR 11 +# define MINLINUX_PATCH 0 +#elif QT_CONFIG(getentropy) # define MINLINUX_MAJOR 3 # define MINLINUX_MINOR 17 # define MINLINUX_PATCH 0 diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 0159bc4128..5a5a3a82c6 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2017 Intel Corporation. +** Copyright (C) 2018 Intel Corporation. ** Copyright (C) 2016 The Qt Company Ltd. ** Copyright (C) 2013 Samuel Gaist <samuel.gaist@edeltech.ch> ** Contact: https://www.qt.io/licensing/ @@ -86,7 +86,6 @@ extern "C" NSString *NSTemporaryDirectory(); #if defined(Q_OS_LINUX) # include <sys/ioctl.h> -# include <sys/syscall.h> # include <sys/sendfile.h> # include <linux/fs.h> @@ -94,28 +93,13 @@ extern "C" NSString *NSTemporaryDirectory(); #ifndef FICLONE # define FICLONE _IOW(0x94, 9, int) #endif +#endif -# if defined(Q_OS_ANDROID) -// renameat2() and statx() are disabled on Android because quite a few systems +#if defined(Q_OS_ANDROID) +// statx() is disabled on Android because quite a few systems // come with sandboxes that kill applications that make system calls outside a // whitelist and several Android vendors can't be bothered to update the list. -# undef SYS_renameat2 -# undef SYS_statx -# undef STATX_BASIC_STATS -# else -# if !QT_CONFIG(renameat2) && defined(SYS_renameat2) -static int renameat2(int oldfd, const char *oldpath, int newfd, const char *newpath, unsigned flags) -{ return syscall(SYS_renameat2, oldfd, oldpath, newfd, newpath, flags); } -# endif - -# if !QT_CONFIG(statx) && defined(SYS_statx) -# include <linux/stat.h> -static int statx(int dirfd, const char *pathname, int flag, unsigned mask, struct statx *statxbuf) -{ return syscall(SYS_statx, dirfd, pathname, flag, mask, statxbuf); } -# elif !QT_CONFIG(statx) && !defined(SYS_statx) -# undef STATX_BASIC_STATS -# endif -# endif // !Q_OS_ANDROID +# undef STATX_BASIC_STATS #endif #ifndef STATX_ALL @@ -329,22 +313,8 @@ mtime(const T &statBuffer, int) #ifdef STATX_BASIC_STATS static int qt_real_statx(int fd, const char *pathname, int flags, struct statx *statxBuffer) { -#ifdef Q_ATOMIC_INT8_IS_SUPPORTED - static QBasicAtomicInteger<qint8> statxTested = Q_BASIC_ATOMIC_INITIALIZER(0); -#else - static QBasicAtomicInt statxTested = Q_BASIC_ATOMIC_INITIALIZER(0); -#endif - - if (statxTested.load() == -1) - return -ENOSYS; - unsigned mask = STATX_BASIC_STATS | STATX_BTIME; int ret = statx(fd, pathname, flags, mask, statxBuffer); - if (ret == -1 && errno == ENOSYS) { - statxTested.store(-1); - return -ENOSYS; - } - statxTested.store(1); return ret == -1 ? -errno : 0; } @@ -1278,14 +1248,12 @@ bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSy if (Q_UNLIKELY(srcPath.isEmpty() || tgtPath.isEmpty())) return emptyFileEntryWarning(), false; -#if defined(RENAME_NOREPLACE) && (QT_CONFIG(renameat2) || defined(SYS_renameat2)) +#if defined(RENAME_NOREPLACE) && QT_CONFIG(renameat2) if (renameat2(AT_FDCWD, srcPath, AT_FDCWD, tgtPath, RENAME_NOREPLACE) == 0) return true; - // If we're using syscall(), check for ENOSYS; - // if renameat2 came from libc, we don't accept ENOSYS. // We can also get EINVAL for some non-local filesystems. - if ((QT_CONFIG(renameat2) || errno != ENOSYS) && errno != EINVAL) { + if (errno != EINVAL) { error = QSystemError(errno, QSystemError::StandardLibraryError); return false; } diff --git a/src/corelib/kernel/qwineventnotifier.cpp b/src/corelib/kernel/qwineventnotifier.cpp index 85d4ad4fa9..3c73c0b851 100644 --- a/src/corelib/kernel/qwineventnotifier.cpp +++ b/src/corelib/kernel/qwineventnotifier.cpp @@ -257,6 +257,14 @@ static void CALLBACK wfsoCallback(void *context, BOOLEAN /*ignore*/) { QWinEventNotifierPrivate *nd = reinterpret_cast<QWinEventNotifierPrivate *>(context); QAbstractEventDispatcher *eventDispatcher = nd->threadData->eventDispatcher.load(); + + // Happens when Q(Core)Application is destroyed before QWinEventNotifier. + // https://bugreports.qt.io/browse/QTBUG-70214 + if (!eventDispatcher) { // perhaps application is shutting down + qWarning("QWinEventNotifier: no event dispatcher, application shutting down? Cannot deliver event."); + return; + } + QEventDispatcherWin32Private *edp = QEventDispatcherWin32Private::get( static_cast<QEventDispatcherWin32 *>(eventDispatcher)); ++nd->signaledCount; |