about summary refs log tree commit diff
path: root/libio/bug-ungetc4.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 /libio/bug-ungetc4.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 'libio/bug-ungetc4.c')
-rw-r--r--libio/bug-ungetc4.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libio/bug-ungetc4.c b/libio/bug-ungetc4.c
index 0bd02a570d..8a05def686 100644
--- a/libio/bug-ungetc4.c
+++ b/libio/bug-ungetc4.c
@@ -18,6 +18,8 @@
 
 #include <stdio.h>
 
+#include <support/xunistd.h>
+
 static void do_prepare (void);
 #define PREPARE(argc, argv) do_prepare ()
 static int do_test (void);
@@ -36,7 +38,7 @@ do_prepare (void)
       printf ("cannot create temporary file: %m\n");
       exit (1);
     }
-  write (fd, pattern, sizeof (pattern) - 1);
+  xwrite (fd, pattern, sizeof (pattern) - 1);
   close (fd);
 }