From 026a84a54d3b6c23b999b793e2a6f8ecd211e3b8 Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Thu, 1 Jun 2023 12:40:05 -0400 Subject: tests: replace write by xwrite Using write without cheks leads to warn unused result when __wur is enabled. Reviewed-by: Siddhesh Poyarekar --- io/tst-faccessat.c | 3 ++- io/tst-fchmodat.c | 3 ++- io/tst-fchownat.c | 3 ++- io/tst-fstatat.c | 3 ++- io/tst-futimesat.c | 3 ++- io/tst-linkat.c | 3 ++- io/tst-openat.c | 3 ++- io/tst-renameat.c | 3 ++- io/tst-symlinkat.c | 3 ++- io/tst-unlinkat.c | 3 ++- 10 files changed, 20 insertions(+), 10 deletions(-) (limited to 'io') diff --git a/io/tst-faccessat.c b/io/tst-faccessat.c index 7bdeed008c..b90954e318 100644 --- a/io/tst-faccessat.c +++ b/io/tst-faccessat.c @@ -8,6 +8,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -96,7 +97,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); /* Before closing the file, try using this file descriptor to open diff --git a/io/tst-fchmodat.c b/io/tst-fchmodat.c index 7d4a8717ff..83003e2f21 100644 --- a/io/tst-fchmodat.c +++ b/io/tst-fchmodat.c @@ -8,6 +8,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -98,7 +99,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-fchownat.c b/io/tst-fchownat.c index e8adf6229f..c0b87cda8f 100644 --- a/io/tst-fchownat.c +++ b/io/tst-fchownat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -106,7 +107,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-fstatat.c b/io/tst-fstatat.c index 4766bb2e71..6a60024b63 100644 --- a/io/tst-fstatat.c +++ b/io/tst-fstatat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-futimesat.c b/io/tst-futimesat.c index 3d41721f42..b7ef386e06 100644 --- a/io/tst-futimesat.c +++ b/io/tst-futimesat.c @@ -28,6 +28,7 @@ #include #include +#include #ifndef struct_stat # define struct_stat struct stat64 @@ -114,7 +115,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct_stat st1; diff --git a/io/tst-linkat.c b/io/tst-linkat.c index 97445b7954..6b22a01c88 100644 --- a/io/tst-linkat.c +++ b/io/tst-linkat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-openat.c b/io/tst-openat.c index 741b8d0ad2..2ce89e3db1 100644 --- a/io/tst-openat.c +++ b/io/tst-openat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); /* Before closing the file, try using this file descriptor to open another file. This must fail. */ diff --git a/io/tst-renameat.c b/io/tst-renameat.c index 435302b52b..0b9da5fd6d 100644 --- a/io/tst-renameat.c +++ b/io/tst-renameat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-symlinkat.c b/io/tst-symlinkat.c index 214a8e348e..4a34994df7 100644 --- a/io/tst-symlinkat.c +++ b/io/tst-symlinkat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); puts ("file created"); struct stat64 st1; diff --git a/io/tst-unlinkat.c b/io/tst-unlinkat.c index e21d56f9f7..21a2dbaf57 100644 --- a/io/tst-unlinkat.c +++ b/io/tst-unlinkat.c @@ -6,6 +6,7 @@ #include #include +#include static void prepare (void); #define PREPARE(argc, argv) prepare () @@ -94,7 +95,7 @@ do_test (void) puts ("file creation failed"); return 1; } - write (fd, "hello", 5); + xwrite (fd, "hello", 5); close (fd); puts ("file created"); -- cgit 1.4.1