public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc/siddhesh/gai-cleanup2] io: Add fsync call in tst-stat
@ 2022-03-01  2:40 Siddhesh Poyarekar
  0 siblings, 0 replies; only message in thread
From: Siddhesh Poyarekar @ 2022-03-01  2:40 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=ae132284092edc5885315b44cd17d5ea91177e49

commit ae132284092edc5885315b44cd17d5ea91177e49
Author: Florian Weimer <fweimer@redhat.com>
Date:   Mon Feb 28 11:50:41 2022 +0100

    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.

Diff:
---
 io/tst-stat.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/io/tst-stat.c b/io/tst-stat.c
index 2b7975e162..237988203a 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");


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-01  2:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-01  2:40 [glibc/siddhesh/gai-cleanup2] io: Add fsync call in tst-stat Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).