about summary refs log tree commit diff
path: root/time/tst-cpuclock1.c
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-06-01 12:40:05 -0400
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-01 12:40:05 -0400
commit026a84a54d3b6c23b999b793e2a6f8ecd211e3b8 (patch)
treea2d31c6c98b1de645aee08e9f8d907ec1961bd7d /time/tst-cpuclock1.c
parenta8c888997845c5192e446176374c2e13bb3e2195 (diff)
downloadglibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.tar.gz
glibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.tar.xz
glibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.zip
tests: replace write by xwrite
Using write without cheks leads to warn unused result when __wur is
enabled.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'time/tst-cpuclock1.c')
-rw-r--r--time/tst-cpuclock1.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/time/tst-cpuclock1.c b/time/tst-cpuclock1.c
index 6f2e70a58a..6a793e06df 100644
--- a/time/tst-cpuclock1.c
+++ b/time/tst-cpuclock1.c
@@ -27,6 +27,8 @@
 #include <stdint.h>
 #include <sys/wait.h>
 
+#include <support/xunistd.h>
+
 /* This function is intended to rack up both user and system time.  */
 static void
 chew_cpu (void)
@@ -41,7 +43,7 @@ chew_cpu (void)
       for (int i = 0; i < 100; ++i)
 	for (size_t j = 0; j < sizeof buf; ++j)
 	  buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
       if (getppid () == 1)
 	_exit (2);