diff options
-rw-r--r-- | src/corelib/configure.cmake | 20 | ||||
-rw-r--r-- | src/corelib/global/qconfig-bootstrapped.h | 1 | ||||
-rw-r--r-- | src/corelib/io/qfilesystemengine_unix.cpp | 62 |
3 files changed, 0 insertions, 83 deletions
diff --git a/src/corelib/configure.cmake b/src/corelib/configure.cmake index d2e8fa4205..089892cbcc 100644 --- a/src/corelib/configure.cmake +++ b/src/corelib/configure.cmake @@ -229,22 +229,6 @@ futimens(-1, 0); /* END TEST: */ return 0; } -"# FIXME: qmake: ["# Block futimens() on Apple platforms unless it's available on ALL", '# deployment targets. This simplifies the logic at the call site', "# dramatically, as it isn't strictly needed compared to futimes().", 'darwin: QMAKE_CXXFLAGS += -Werror=unguarded-availability -Werror=unguarded-availability-new', 'CONFIG += warn_on'] -) - -# futimes -qt_config_compile_test(futimes - LABEL "futimes()" - CODE -"#include <sys/time.h> - -int main(void) -{ - /* BEGIN TEST: */ -futimes(-1, 0); - /* END TEST: */ - return 0; -} ") # getauxval @@ -578,10 +562,6 @@ qt_feature("futimens" PRIVATE LABEL "futimens()" CONDITION NOT WIN32 AND TEST_futimens ) -qt_feature("futimes" PRIVATE - LABEL "futimes()" - CONDITION NOT WIN32 AND NOT QT_FEATURE_futimens AND TEST_futimes -) qt_feature("getauxval" PRIVATE LABEL "getauxval()" CONDITION LINUX AND TEST_getauxval diff --git a/src/corelib/global/qconfig-bootstrapped.h b/src/corelib/global/qconfig-bootstrapped.h index ff5709f7af..78d622f5e9 100644 --- a/src/corelib/global/qconfig-bootstrapped.h +++ b/src/corelib/global/qconfig-bootstrapped.h @@ -63,7 +63,6 @@ #define QT_FEATURE_jalalicalendar -1 #define QT_FEATURE_journald -1 #define QT_FEATURE_futimens -1 -#define QT_FEATURE_futimes -1 #define QT_FEATURE_future -1 #define QT_FEATURE_itemmodel -1 #define QT_FEATURE_library -1 diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp index 0645952091..b727463a3c 100644 --- a/src/corelib/io/qfilesystemengine_unix.cpp +++ b/src/corelib/io/qfilesystemengine_unix.cpp @@ -159,41 +159,6 @@ static bool isPackage(const QFileSystemMetaData &data, const QFileSystemEntry &e namespace { namespace GetFileTimes { -#if !QT_CONFIG(futimens) && (QT_CONFIG(futimes)) -template <typename T> -static inline typename std::enable_if_t<(&T::st_atim, &T::st_mtim, true)> get(const T *p, struct timeval *access, struct timeval *modification) -{ - access->tv_sec = p->st_atim.tv_sec; - access->tv_usec = p->st_atim.tv_nsec / 1000; - - modification->tv_sec = p->st_mtim.tv_sec; - modification->tv_usec = p->st_mtim.tv_nsec / 1000; -} - -template <typename T> -static inline typename std::enable_if_t<(&T::st_atimespec, &T::st_mtimespec, true)> get(const T *p, struct timeval *access, struct timeval *modification) -{ - access->tv_sec = p->st_atimespec.tv_sec; - access->tv_usec = p->st_atimespec.tv_nsec / 1000; - - modification->tv_sec = p->st_mtimespec.tv_sec; - modification->tv_usec = p->st_mtimespec.tv_nsec / 1000; -} - -# ifndef st_atimensec -// if "st_atimensec" is defined, this would expand to invalid C++ -template <typename T> -static inline typename std::enable_if_t<(&T::st_atimensec, &T::st_mtimensec, true)> get(const T *p, struct timeval *access, struct timeval *modification) -{ - access->tv_sec = p->st_atime; - access->tv_usec = p->st_atimensec / 1000; - - modification->tv_sec = p->st_mtime; - modification->tv_usec = p->st_mtimensec / 1000; -} -# endif -#endif - qint64 timespecToMSecs(const timespec &spec) { return (qint64(spec.tv_sec) * 1000) + (spec.tv_nsec / 1000000); @@ -1568,33 +1533,6 @@ bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractF } return true; -#elif QT_CONFIG(futimes) - struct timeval tv[2]; - QT_STATBUF st; - - if (QT_FSTAT(fd, &st) == -1) { - error = QSystemError(errno, QSystemError::StandardLibraryError); - return false; - } - - GetFileTimes::get(&st, &tv[0], &tv[1]); - - const qint64 msecs = newDate.toMSecsSinceEpoch(); - - if (time == QAbstractFileEngine::AccessTime) { - tv[0].tv_sec = msecs / 1000; - tv[0].tv_usec = (msecs % 1000) * 1000; - } else if (time == QAbstractFileEngine::ModificationTime) { - tv[1].tv_sec = msecs / 1000; - tv[1].tv_usec = (msecs % 1000) * 1000; - } - - if (futimes(fd, tv) == -1) { - error = QSystemError(errno, QSystemError::StandardLibraryError); - return false; - } - - return true; #else Q_UNUSED(fd); error = QSystemError(ENOSYS, QSystemError::StandardLibraryError); |