tests: replace read by xread
commit20b6b8e8a50874dd189687df8f6f8a11d4813b34
authorFrédéric Bérat <fberat@redhat.com>
Wed, 14 Jun 2023 08:52:06 +0000 (14 10:52 +0200)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Mon, 19 Jun 2023 13:14:56 +0000 (19 09:14 -0400)
treedadbbe8e8c05cf8a9c647b9c9b3198c086fec475
parentcf30aa43a5917f441c9438aaee201c53c8e1d76b
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 <siddhesh@sourceware.org>
dirent/tst-fdopendir.c
nptl/tst-cleanup4.c
support/Makefile
support/test-container.c
support/xread.c [new file with mode: 0644]
support/xunistd.h
sysdeps/pthread/Makefile
sysdeps/pthread/tst-cancel11.c
sysdeps/pthread/tst-cancel20.c
sysdeps/pthread/tst-cancel21.c
sysdeps/pthread/tst-fini1mod.c