about summary refs log tree commit diff
path: root/io
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 /io
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 'io')
-rw-r--r--io/tst-faccessat.c3
-rw-r--r--io/tst-fchmodat.c3
-rw-r--r--io/tst-fchownat.c3
-rw-r--r--io/tst-fstatat.c3
-rw-r--r--io/tst-futimesat.c3
-rw-r--r--io/tst-linkat.c3
-rw-r--r--io/tst-openat.c3
-rw-r--r--io/tst-renameat.c3
-rw-r--r--io/tst-symlinkat.c3
-rw-r--r--io/tst-unlinkat.c3
10 files changed, 20 insertions, 10 deletions
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 <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 7d4a8717ff..83003e2f21 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 e8adf6229f..c0b87cda8f 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 4766bb2e71..6a60024b63 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 3d41721f42..b7ef386e06 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 97445b7954..6b22a01c88 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 741b8d0ad2..2ce89e3db1 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 435302b52b..0b9da5fd6d 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 214a8e348e..4a34994df7 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 e21d56f9f7..21a2dbaf57 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");