[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
test builtin does not check for nanoseconds while comparing timestamps
From: |
Siteshwar Vashisht |
Subject: |
test builtin does not check for nanoseconds while comparing timestamps |
Date: |
Fri, 2 Jun 2017 20:30:20 -0400 (EDT) |
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
0001-Fix-macro-check-for-struct-stat.st_atim.tv_nsec.patch
Description: Text Data
- test builtin does not check for nanoseconds while comparing timestamps,
Siteshwar Vashisht <=