summaryrefslogtreecommitdiffstats
path: root/src/corelib/io
diff options
context:
space:
mode:
authorAhmad Samir <a.samirh78@gmail.com>2022-10-31 22:57:24 +0200
committerAhmad Samir <a.samirh78@gmail.com>2022-11-09 14:22:29 +0200
commitcb9d76169aefc95f4e8962dcbff98bedd63a3e50 (patch)
treeb1494346351d9ec5a1a8c1724e83d221e9121ba2 /src/corelib/io
parentef935f6e37a24f52255e6696b85a0fa9aaa7361a (diff)
QFileSystemEngine/Unix: remove futimes related code
- futimes isn't a standard system call[1]: « This system call is nonstandard. It was implemented from a specification that was proposed for POSIX.1, but that specification was replaced by the one for utimensat(2). A similar system call exists on Solaris. » [1] https://man7.org/linux/man-pages/man2/futimesat.2.html [2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html - futimens is a standard system call[2], it's available on: - Linux: https://man7.org/linux/man-pages/man2/futimesat.2.html - FreeBSD: https://www.freebsd.org/cgi/man.cgi?query=futimens&sektion=2&n=1 - OpenBSD: https://man.openbsd.org/futimens.2 - QNX: https://www.qnx.com/developers/docs/7.1/#com.qnx.doc.neutrino.lib_ref/topic/f/futimens.html So, remove futimes related code. Change-Id: I58ac466f08161a88219e3a32eab98d168f065140 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/io')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp62
1 files changed, 0 insertions, 62 deletions
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);