From 20b6b8e8a50874dd189687df8f6f8a11d4813b34 Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Wed, 14 Jun 2023 10:52:06 +0200 Subject: tests: replace read by xread With fortification enabled, read calls return result needs to be checked, has it gets the __wur macro enabled. Note on read call removal from sysdeps/pthread/tst-cancel20.c and sysdeps/pthread/tst-cancel21.c: It is assumed that this second read call was there to overcome the race condition between pipe closure and thread cancellation that could happen in the original code. Since this race condition got fixed by d0e3ffb7a58854248f1d5e737610d50cd0a60f46 the second call seems superfluous. Hence, instead of checking for the return value of read, it looks reasonable to simply remove it. Reviewed-by: Siddhesh Poyarekar --- dirent/tst-fdopendir.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'dirent') diff --git a/dirent/tst-fdopendir.c b/dirent/tst-fdopendir.c index 2c9520574d..d6a24f47db 100644 --- a/dirent/tst-fdopendir.c +++ b/dirent/tst-fdopendir.c @@ -45,7 +45,8 @@ do_test (void) } char buf[5]; - read(fd, buf, sizeof (buf)); + xread(fd, buf, sizeof (buf)); + close(fd); struct stat64 st2; -- cgit 1.4.1