aboutsummaryrefslogtreecommitdiff
path: root/io
diff options
context:
space:
mode:
authorFlorian Weimer <fweimer@redhat.com>2022-02-28 11:50:41 +0100
committerFlorian Weimer <fweimer@redhat.com>2022-02-28 11:50:41 +0100
commitae132284092edc5885315b44cd17d5ea91177e49 (patch)
treecef7392c524894598c1fd8b6ee9e46bdf551799f /io
parent73fc4e28b9464f0e13edc719a5372839970e7ddb (diff)
downloadglibc-ae132284092edc5885315b44cd17d5ea91177e49.zip
glibc-ae132284092edc5885315b44cd17d5ea91177e49.tar.gz
glibc-ae132284092edc5885315b44cd17d5ea91177e49.tar.bz2
io: Add fsync call in tst-stat
io/tst-stat and io/tst-stat-lfs fail sporadically on the Fedora builders, and this change hopefully helps to avoid the issue.
Diffstat (limited to 'io')
-rw-r--r--io/tst-stat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/io/tst-stat.c b/io/tst-stat.c
index 2b7975e..2379882 100644
--- a/io/tst-stat.c
+++ b/io/tst-stat.c
@@ -69,6 +69,10 @@ do_test (void)
TEST_VERIFY_EXIT (fd >= 0);
support_write_file_string (path, "abc");
+ /* This should help to prevent delayed allocation, which may result
+ in a spurious stx_blocks/st_blocks difference. */
+ fsync (fd);
+
bool check_ns = support_stat_nanoseconds (path);
if (!check_ns)
printf ("warning: timestamp with nanoseconds not supported\n");