File: nonlinux_utime.diff

package info (click to toggle)
qtbase-opensource-src 5.11.3%2Bdfsg1-1%2Bdeb10u5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 313,804 kB
  • sloc: cpp: 1,831,962; ansic: 318,856; xml: 113,585; python: 9,691; java: 7,209; asm: 4,023; perl: 2,151; sh: 1,790; yacc: 1,733; lex: 1,197; javascript: 469; makefile: 301; objc: 70
file content (33 lines) | stat: -rw-r--r-- 1,268 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
Description: guard UTIME_NOW/UTIME_OMIT usages
Author: Dmitry Shachnev <mitya57@debian.org>
Author: Pino Toscano <pino@debian.org>
Forwarded: no
Last-Update: 2018-02-22

---
 qmake/library/ioutils.cpp                 |    2 +-
 src/corelib/io/qfilesystemengine_unix.cpp |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

--- a/qmake/library/ioutils.cpp
+++ b/qmake/library/ioutils.cpp
@@ -222,7 +222,7 @@ bool IoUtils::touchFile(const QString &t
         *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
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -1407,7 +1407,7 @@ bool QFileSystemEngine::setFileTime(int
         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;