guard UTIME_NOW/UTIME_OMIT usages

Forwarded: no
Last-Update: 2018-02-22

Gbp-Pq: Name nonlinux_utime.diff
This commit is contained in:
Dmitry Shachnev 2022-05-14 17:41:01 +08:00 committed by openKylinBot
parent 7378d28c3d
commit 47fd91bb89
2 changed files with 2 additions and 2 deletions

View 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))); *errorString = fL1S("Cannot stat() reference file %1: %2.").arg(referenceFileName, fL1S(strerror(errno)));
return false; 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 struct timespec times[2] = { { 0, UTIME_NOW }, st.st_mtim };
const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0; const bool utimeError = utimensat(AT_FDCWD, targetFileName.toLocal8Bit().constData(), times, 0) < 0;
# else # else

View File

@ -1595,7 +1595,7 @@ bool QFileSystemEngine::setFileTime(int fd, const QDateTime &newDate, QAbstractF
return false; return false;
} }
#if QT_CONFIG(futimens) #if QT_CONFIG(futimens) && defined(UTIME_OMIT)
struct timespec ts[2]; struct timespec ts[2];
ts[0].tv_sec = ts[1].tv_sec = 0; ts[0].tv_sec = ts[1].tv_sec = 0;