guard UTIME_NOW/UTIME_OMIT usages
authorDmitry Shachnev <mitya57@debian.org>
Sun, 7 Aug 2022 13:56:40 +0000 (14:56 +0100)
committerDmitry Shachnev <mitya57@debian.org>
Sun, 7 Aug 2022 13:56:40 +0000 (14:56 +0100)
Forwarded: no
Last-Update: 2018-02-22

Gbp-Pq: Name nonlinux_utime.diff

qmake/library/ioutils.cpp
src/corelib/io/qfilesystemengine_unix.cpp

index d2171274d80952013bbd6f5f53d3fb4b8f231d4c..6fada0005779aff8c90b94f7da491db0983f04a8 100644 (file)
@@ -228,7 +228,7 @@ bool IoUtils::touchFile(const QString &targetFileName, const QString &referenceF
         *errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
         return false;
     }
-#    if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L
+#    if defined(_POSIX_VERSION) && _POSIX_VERSION >= 200809L && defined(UTIME_NOW)
     const struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
     const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0;
 #    else
index f32bb5248b94a9c0eb21e38b9f4b1281f888d5c7..58e06ee1c2c3ba8675955c415680394d34320433 100644 (file)
@@ -1595,7 +1595,7 @@ bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractF
         return false;
     }
 
-#if QT_CONFIG(futimens)
+#if QT_CONFIG(futimens) && defined(UTIME_OMIT)
     struct timespec ts[2];
 
     ts[0].tv_sec = ts[1].tv_sec = 0;