Configuration Information [Automatically generated, do not change]:
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu'
-DCONF_VENDOR='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I. -I./include -I./lib -D_GNU_SOURCE -DRECYCLES_PIDS
-DDEFAULT_PATH_VALUE='/usr/local/bin:/usr/bin' -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic
uname output: Linux localhost.localdomain 4.10.17-200.fc25.x86_64 #1 SMP Mon
May 22 18:12:57 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu
Bash Version: 4.3
Patch Level: 43
Release Status: release
Description:
If the modified timestamp of 2 files differ by less than 1 second, test
builtin sometimes returns incorrect result. It happens because
HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC is not defined in config.h.
Repeat-By:
while true; do touch a; sleep 0.1; touch b; stat a b|grep Modify; [ b
-nt a ] && echo test_cmd_ok || echo test_cmd_failed; echo; done
Fix:
Attached patch fixes this issue.
--
--
Siteshwar Vashisht
From 2648afeb4e2bae4e250700c8fb37e2aa64c82b11 Mon Sep 17 00:00:00 2001
From: Siteshwar Vashisht <[email protected]>
Date: Sat, 3 Jun 2017 01:37:08 +0200
Subject: [PATCH] Fix macro check for struct stat.st_atim.tv_nsec
---
config.h.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/config.h.in b/config.h.in
index b5c35c3..1e4b71d 100644
--- a/config.h.in
+++ b/config.h.in
@@ -452,6 +452,7 @@
#undef SYS_TIME_H_DEFINES_STRUCT_TIMESPEC
#undef PTHREAD_H_DEFINES_STRUCT_TIMESPEC
+#undef HAVE_STRUCT_STAT_ST_ATIM_TV_NSEC
#undef TYPEOF_STRUCT_STAT_ST_ATIM_IS_STRUCT_TIMESPEC
#undef HAVE_STRUCT_STAT_ST_ATIMESPEC_TV_NSEC
#undef HAVE_STRUCT_STAT_ST_ATIMENSEC
--
2.9.4