diff options
author | Frédéric Bérat <fberat@redhat.com> | 2023-06-01 12:40:05 -0400 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2023-06-01 12:40:05 -0400 |
commit | 026a84a54d3b6c23b999b793e2a6f8ecd211e3b8 (patch) | |
tree | a2d31c6c98b1de645aee08e9f8d907ec1961bd7d /libio | |
parent | a8c888997845c5192e446176374c2e13bb3e2195 (diff) | |
download | glibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.zip glibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.tar.gz glibc-026a84a54d3b6c23b999b793e2a6f8ecd211e3b8.tar.bz2 |
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')
-rw-r--r-- | libio/bug-ungetc.c | 4 | ||||
-rw-r--r-- | libio/bug-ungetc3.c | 4 | ||||
-rw-r--r-- | libio/bug-ungetc4.c | 4 | ||||
-rw-r--r-- | libio/bug-wfflush.c | 4 | ||||
-rw-r--r-- | libio/bug-wsetpos.c | 4 |
5 files changed, 15 insertions, 5 deletions
diff --git a/libio/bug-ungetc.c b/libio/bug-ungetc.c index 51940b6..4ea2d14 100644 --- a/libio/bug-ungetc.c +++ b/libio/bug-ungetc.c @@ -2,6 +2,8 @@ #include <stdio.h> +#include <support/xunistd.h> + static void do_prepare (void); #define PREPARE(argc, argv) do_prepare () static int do_test (void); @@ -20,7 +22,7 @@ do_prepare (void) printf ("cannot create temporary file: %m\n"); exit (1); } - write (fd, pattern, sizeof (pattern)); + xwrite (fd, pattern, sizeof (pattern)); close (fd); } diff --git a/libio/bug-ungetc3.c b/libio/bug-ungetc3.c index 0c83c11..6100d7a 100644 --- a/libio/bug-ungetc3.c +++ b/libio/bug-ungetc3.c @@ -2,6 +2,8 @@ #include <stdio.h> +#include <support/xunistd.h> + static void do_prepare (void); #define PREPARE(argc, argv) do_prepare () static int do_test (void); @@ -20,7 +22,7 @@ do_prepare (void) printf ("cannot create temporary file: %m\n"); exit (1); } - write (fd, pattern, sizeof (pattern)); + xwrite (fd, pattern, sizeof (pattern)); close (fd); } diff --git a/libio/bug-ungetc4.c b/libio/bug-ungetc4.c index 0bd02a5..8a05def 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); } diff --git a/libio/bug-wfflush.c b/libio/bug-wfflush.c index a8fd61e..d1b9d8e 100644 --- a/libio/bug-wfflush.c +++ b/libio/bug-wfflush.c @@ -3,6 +3,8 @@ #include <stdio.h> #include <wchar.h> +#include <support/xunistd.h> + static void do_prepare (void); #define PREPARE(argc, argv) do_prepare () static int do_test (void); @@ -20,7 +22,7 @@ do_prepare (void) printf ("cannot create temporary file: %m\n"); exit (1); } - write (fd, "1!", 2); + xwrite (fd, "1!", 2); close (fd); } diff --git a/libio/bug-wsetpos.c b/libio/bug-wsetpos.c index ccb22a4..0fc373b 100644 --- a/libio/bug-wsetpos.c +++ b/libio/bug-wsetpos.c @@ -4,6 +4,8 @@ #include <stdio.h> #include <wchar.h> +#include <support/xunistd.h> + static void do_prepare (void); #define PREPARE(argc, argv) do_prepare () static int do_test (void); @@ -22,7 +24,7 @@ do_prepare (void) printf ("cannot create temporary file: %m\n"); exit (1); } - write (fd, pattern, sizeof (pattern)); + xwrite (fd, pattern, sizeof (pattern)); close (fd); } |