Merge tag 'kbuild-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy...
[muen/linux.git] / scripts / adjust_autoksyms.sh
index f11cae6a041bcb1581ed4b2707fdd2e1e021bdaf..016b3c48a4ecaa72dabda569fb2a87a0396a3077 100755 (executable)
@@ -83,6 +83,13 @@ while read sympath; do
        depfile="include/ksym/${sympath}.h"
        mkdir -p "$(dirname "$depfile")"
        touch "$depfile"
        depfile="include/ksym/${sympath}.h"
        mkdir -p "$(dirname "$depfile")"
        touch "$depfile"
+       # Filesystems with coarse time precision may create timestamps
+       # equal to the one from a file that was very recently built and that
+       # needs to be rebuild. Let's guard against that by making sure our
+       # dep files are always newer than the first file we created here.
+       while [ ! "$depfile" -nt "$new_ksyms_file" ]; do
+               touch "$depfile"
+       done
        echo $((count += 1))
 done | tail -1 )
 changed=${changed:-0}
        echo $((count += 1))
 done | tail -1 )
 changed=${changed:-0}