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 /io | |
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 'io')
-rw-r--r-- | io/tst-faccessat.c | 3 | ||||
-rw-r--r-- | io/tst-fchmodat.c | 3 | ||||
-rw-r--r-- | io/tst-fchownat.c | 3 | ||||
-rw-r--r-- | io/tst-fstatat.c | 3 | ||||
-rw-r--r-- | io/tst-futimesat.c | 3 | ||||
-rw-r--r-- | io/tst-linkat.c | 3 | ||||
-rw-r--r-- | io/tst-openat.c | 3 | ||||
-rw-r--r-- | io/tst-renameat.c | 3 | ||||
-rw-r--r-- | io/tst-symlinkat.c | 3 | ||||
-rw-r--r-- | io/tst-unlinkat.c | 3 |
10 files changed, 20 insertions, 10 deletions
diff --git a/io/tst-faccessat.c b/io/tst-faccessat.c index 7bdeed0..b90954e 100644 --- a/io/tst-faccessat.c +++ b/io/tst-faccessat.c @@ -8,6 +8,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 7d4a871..83003e2 100644 --- a/io/tst-fchmodat.c +++ b/io/tst-fchmodat.c @@ -8,6 +8,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 e8adf62..c0b87cd 100644 --- a/io/tst-fchownat.c +++ b/io/tst-fchownat.c @@ -6,6 +6,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 4766bb2..6a60024 100644 --- a/io/tst-fstatat.c +++ b/io/tst-fstatat.c @@ -6,6 +6,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 3d41721..b7ef386 100644 --- a/io/tst-futimesat.c +++ b/io/tst-futimesat.c @@ -28,6 +28,7 @@ #include <support/test-driver.h> #include <support/temp_file.h> +#include <support/xunistd.h> #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 97445b7..6b22a01 100644 --- a/io/tst-linkat.c +++ b/io/tst-linkat.c @@ -6,6 +6,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 741b8d0..2ce89e3 100644 --- a/io/tst-openat.c +++ b/io/tst-openat.c @@ -6,6 +6,7 @@ #include <string.h> #include <unistd.h> +#include <support/xunistd.h> 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 435302b..0b9da5f 100644 --- a/io/tst-renameat.c +++ b/io/tst-renameat.c @@ -6,6 +6,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 214a8e3..4a34994 100644 --- a/io/tst-symlinkat.c +++ b/io/tst-symlinkat.c @@ -6,6 +6,7 @@ #include <unistd.h> #include <sys/stat.h> +#include <support/xunistd.h> 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 e21d56f..21a2dba 100644 --- a/io/tst-unlinkat.c +++ b/io/tst-unlinkat.c @@ -6,6 +6,7 @@ #include <string.h> #include <unistd.h> +#include <support/xunistd.h> 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"); |