]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
tests: replace write by xwrite
authorFrédéric Bérat <fberat@redhat.com>
Thu, 1 Jun 2023 16:40:05 +0000 (12:40 -0400)
committerSiddhesh Poyarekar <siddhesh@sourceware.org>
Thu, 1 Jun 2023 16:40:05 +0000 (12:40 -0400)
Using write without cheks leads to warn unused result when __wur is
enabled.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
32 files changed:
dirent/tst-fdopendir.c
io/tst-faccessat.c
io/tst-fchmodat.c
io/tst-fchownat.c
io/tst-fstatat.c
io/tst-futimesat.c
io/tst-linkat.c
io/tst-openat.c
io/tst-renameat.c
io/tst-symlinkat.c
io/tst-unlinkat.c
libio/bug-ungetc.c
libio/bug-ungetc3.c
libio/bug-ungetc4.c
libio/bug-wfflush.c
libio/bug-wsetpos.c
nptl/tst-stackguard1.c
nptl/tst-tls3.c
nptl/tst-tls3mod.c
rt/tst-cpuclock2.c
rt/tst-cputimer1.c
rt/tst-cputimer2.c
rt/tst-cputimer3.c
support/test-container.c
sysdeps/pthread/tst-cond18.c
sysdeps/pthread/tst-flock1.c
sysdeps/pthread/tst-flock2.c
sysdeps/pthread/tst-key1.c
sysdeps/pthread/tst-signal1.c
sysdeps/pthread/tst-signal2.c
sysdeps/pthread/tst-timer.c
time/tst-cpuclock1.c

index 6321af1daa19964800a439ccdd8564111130bdc0..2c9520574dddfba89da4b688c42da55bdc246039 100644 (file)
@@ -7,6 +7,8 @@
 #include <string.h>
 #include <sys/stat.h>
 
+#include <support/xunistd.h>
+
 #ifndef O_NOATIME
 # define O_NOATIME     0
 #endif
@@ -22,7 +24,7 @@ do_test (void)
       return 1;
     }
 
-  write (fd, "hello", 5);
+  xwrite (fd, "hello", 5);
   close (fd);
 
   struct stat64 st;
index 7bdeed008c1d85f985b777c9eea24836be61cbb4..b90954e3184adfc1d49db5469366378088b37c2a 100644 (file)
@@ -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
index 7d4a8717ff5edfef3f2eafed84dbe3da56301a97..83003e2f219cd26a32d59855b213187497f38dea 100644 (file)
@@ -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;
index e8adf6229fc6033b018c951cd21c3dd59c6faed5..c0b87cda8f42baf0a1574638a9f9c687fb3be8a5 100644 (file)
@@ -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;
index 4766bb2e71f5b2b4e7e276f9ff9dd842df23bd5a..6a60024b631626b21efe9a7a529b77d6c5af405d 100644 (file)
@@ -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;
index 3d41721f42f63ec61fc66da09211cf652d6da4b2..b7ef386e06b8934812fb1da1749e7d01c9ab6742 100644 (file)
@@ -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;
index 97445b7954934bb31a0601c2dc7c90c9bb364419..6b22a01c88f6ef8ae7720c0645e741c3a5eff711 100644 (file)
@@ -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;
index 741b8d0ad2222baaaaff0794d64070ff26229bf4..2ce89e3db1887160186fc347c2d65110a727d923 100644 (file)
@@ -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.  */
index 435302b52b39d41450aa82941e9810ca9882304d..0b9da5fd6d94832b35d1cbdf270926d1f8c13a26 100644 (file)
@@ -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;
index 214a8e348e018ef438ddace694ca9200fe6f918f..4a34994df748bcc66ced0ff60217874424c6ecbf 100644 (file)
@@ -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;
index e21d56f9f7bbfc060084b803cef30d585940c514..21a2dbaf5755b10938f74b0fcdf4724e72c04550 100644 (file)
@@ -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");
 
index 51940b68f529ca5fc6f7289888bb0ed548d63a26..4ea2d14ed6f5ab5cef49e7ac8f130a3fbbb5df3f 100644 (file)
@@ -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);
 }
 
index 0c83c1161eb8a0658ded5b135d5f36dd739d4643..6100d7a9360f26c9a5a0c64123862e81c8a16a01 100644 (file)
@@ -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);
 }
 
index 0bd02a570ddfc0e4f2064119c96b514712904d8e..8a05def686b1f491e9f91872299382ff69468644 100644 (file)
@@ -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);
 }
 
index a8fd61e997f3a3a6abebbd31961553e56f8f8c2f..d1b9d8e9de18215762e140a8116c5bf00a01c838 100644 (file)
@@ -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);
 }
 
index ccb22a4b6225df0b2b7a5c0ee6458cab370c6b29..0fc373ba490c4d408273a5ad5dcb37341a65cab5 100644 (file)
@@ -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);
 }
 
index b9cf6844de597c1d75b64df2d18e2e6794ad8a97..4ac57157e9bf53c97da822bb69da99bfd294df8f 100644 (file)
@@ -27,6 +27,8 @@
 #include <tls.h>
 #include <unistd.h>
 
+#include <support/xunistd.h>
+
 static const char *command;
 static bool child;
 static uintptr_t stack_chk_guard_copy;
@@ -96,7 +98,7 @@ do_test (void)
        else if (ret != NULL)
          return 1;
 
-      write (2, &stack_chk_guard_copy, sizeof (stack_chk_guard_copy));
+      xwrite (2, &stack_chk_guard_copy, sizeof (stack_chk_guard_copy));
       return 0;
     }
 
index b1a40c624a688309b34edd7ae02cf94c4b04548b..33d94c8cc5851dd4396218273dd29b674b14b49d 100644 (file)
@@ -26,6 +26,8 @@
 #include <unistd.h>
 #include <pthreaddef.h>
 
+#include <support/xunistd.h>
+
 #define THE_SIG SIGUSR1
 
 /* The stack size can be overriden.  With a sufficiently large stack
index c6e8910b1e3f0f94a367acf7f2a1e8e7e48835c2..345a48e1c76242d16c062671f0a018dac8922c3a 100644 (file)
@@ -25,6 +25,7 @@
 #include <pthreaddef.h>
 #include <descr.h>
 
+#include <support/xunistd.h>
 
 extern pthread_barrier_t b;
 
@@ -43,7 +44,7 @@ handler (int sig)
 {
   if (sig != THE_SIG)
     {
-      write (STDOUT_FILENO, "wrong signal\n", 13);
+      xwrite (STDOUT_FILENO, "wrong signal\n", 13);
       _exit (1);
     }
 
@@ -51,7 +52,7 @@ handler (int sig)
 
   if (sem_post (&s) != 0)
     {
-      write (STDOUT_FILENO, "sem_post failed\n", 16);
+      xwrite (STDOUT_FILENO, "sem_post failed\n", 16);
       _exit (1);
     }
 }
index e4584d879117a1e908047397c787b322b0cbebb3..8afd34ed9ccfbbd5a07bd7bf47507bac95059502 100644 (file)
@@ -37,6 +37,8 @@ do_test ()
 #include <errno.h>
 #include <pthread.h>
 
+#include <support/xunistd.h>
+
 static pthread_barrier_t barrier;
 
 /* This function is intended to rack up both user and system time.  */
@@ -55,7 +57,7 @@ chew_cpu (void *arg)
       for (int i = 0; i < 100; ++i)
        for (size_t j = 0; j < sizeof buf; ++j)
          buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
     }
 
index 8f5dd76cf2ab7010c3aeaae0bdc4f687c6fe6537..18d8b195a27da3c7c6a7f92c5345f3dd9b4cebb8 100644 (file)
@@ -11,6 +11,8 @@
 #include <time.h>
 #include <pthread.h>
 
+#include <support/xunistd.h>
+
 #define TEST_CLOCK CLOCK_PROCESS_CPUTIME_ID
 #define TEST_CLOCK_MISSING(clock) \
   (setup_test () ? "process CPU clock timer support" : NULL)
@@ -29,7 +31,7 @@ chew_cpu (void *arg)
       for (int i = 0; i < 100; ++i)
        for (size_t j = 0; j < sizeof buf; ++j)
          buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
     }
 
index 397d7998c0cefdcdc90b1894e7b040670cf524e2..a5700d4bac416f55307982da295a0e743574ac5e 100644 (file)
@@ -12,6 +12,8 @@
 #include <time.h>
 #include <pthread.h>
 
+#include <support/xunistd.h>
+
 static clockid_t worker_thread_clock;
 
 #define TEST_CLOCK worker_thread_clock
@@ -32,7 +34,7 @@ chew_cpu (void *arg)
       for (int i = 0; i < 100; ++i)
        for (size_t j = 0; j < sizeof buf; ++j)
          buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
     }
 
index 056766a3774ce36a3a7029f200bde76bb96acb72..786de93a02cd39f2ca25e317f1371d006fee64c2 100644 (file)
@@ -13,6 +13,8 @@
 #include <signal.h>
 #include <sys/wait.h>
 
+#include <support/xunistd.h>
+
 static clockid_t child_clock;
 
 #define TEST_CLOCK child_clock
@@ -33,7 +35,7 @@ chew_cpu (void)
       for (int i = 0; i < 100; ++i)
        for (size_t j = 0; j < sizeof buf; ++j)
          buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
       if (getppid () == 1)
        _exit (2);
index e68f16eecfddc918ccfafea28403f64420c1bc77..d4ca41fe7c9eb086f88e6d65d17828aa1468da31 100644 (file)
@@ -1186,7 +1186,7 @@ main (int argc, char **argv)
       int status;
 
       /* Send the child's "outside" pid to it.  */
-      write (pipes[1], &child, sizeof(child));
+      xwrite (pipes[1], &child, sizeof(child));
       close (pipes[0]);
       close (pipes[1]);
 
@@ -1255,7 +1255,7 @@ main (int argc, char **argv)
 
       sprintf (tmp, "%lld %lld 1\n",
               (long long) (be_su ? 0 : original_uid), (long long) original_uid);
-      write (UMAP, tmp, strlen (tmp));
+      xwrite (UMAP, tmp, strlen (tmp));
       xclose (UMAP);
 
       /* We must disable setgroups () before we can map our groups, else we
@@ -1264,7 +1264,7 @@ main (int argc, char **argv)
       if (GMAP >= 0)
        {
          /* We support kernels old enough to not have this.  */
-         write (GMAP, "deny\n", 5);
+         xwrite (GMAP, "deny\n", 5);
          xclose (GMAP);
        }
 
@@ -1276,7 +1276,7 @@ main (int argc, char **argv)
 
       sprintf (tmp, "%lld %lld 1\n",
               (long long) (be_su ? 0 : original_gid), (long long) original_gid);
-      write (GMAP, tmp, strlen (tmp));
+      xwrite (GMAP, tmp, strlen (tmp));
       xclose (GMAP);
     }
 
index edac4fa4ff2234288de074245ac0c5c9711960c6..ffae356c04320ec6a2ce4cebc25b17044be07848 100644 (file)
@@ -24,6 +24,8 @@
 #include <stdio.h>
 #include <unistd.h>
 
+#include <support/xunistd.h>
+
 pthread_cond_t cv = PTHREAD_COND_INITIALIZER;
 pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
 bool exiting;
@@ -40,7 +42,7 @@ tf (void *id)
       while (!exiting)
        {
          if ((spins++ % 1000) == 0)
-           write (fd, ".", 1);
+           xwrite (fd, ".", 1);
          pthread_mutex_unlock (&lock);
 
          pthread_mutex_lock (&lock);
index 7eef9070ab514afa414b4de537c160aa9c4d6680..9de148afd31a10a671d6496985300992e624f89b 100644 (file)
@@ -21,6 +21,7 @@
 #include <unistd.h>
 #include <sys/file.h>
 
+#include <support/xunistd.h>
 
 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
 
@@ -56,7 +57,7 @@ do_test (void)
 
   unlink (tmp);
 
-  write (fd, "foobar xyzzy", 12);
+  xwrite (fd, "foobar xyzzy", 12);
 
   if (flock (fd, LOCK_EX | LOCK_NB) != 0)
     {
index 8762e93b52265ebe35559177ac1eefa8eb1e5999..952b79e5dbe4921a2e22e7ac5a0bec748c0b09ae 100644 (file)
@@ -24,6 +24,7 @@
 #include <sys/mman.h>
 #include <sys/wait.h>
 
+#include <support/xunistd.h>
 
 static pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
 static pthread_mutex_t lock2 = PTHREAD_MUTEX_INITIALIZER;
@@ -70,7 +71,7 @@ do_test (void)
 
   int i;
   for (i = 0; i < 20; ++i)
-    write (fd, "foobar xyzzy", 12);
+    xwrite (fd, "foobar xyzzy", 12);
 
   pthread_barrier_t *b;
   b = mmap (NULL, sizeof (pthread_barrier_t), PROT_READ | PROT_WRITE,
index 933edafef8b126e10473b2ce2f9728581e3af122..60245c4e476b56ca745709a47bc23cf747ef2e0f 100644 (file)
@@ -21,6 +21,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <support/xunistd.h>
 
 static int do_test (void);
 
@@ -51,7 +52,7 @@ do_test (void)
 
        if (pthread_setspecific (keys[i], (const void *) (i + 100l)) != 0)
          {
-           write (2, "setspecific failed\n", 19);
+           xwrite (2, "setspecific failed\n", 19);
            _exit (1);
          }
       }
@@ -60,13 +61,13 @@ do_test (void)
     {
       if (pthread_getspecific (keys[i]) != (void *) (i + 100l))
        {
-         write (2, "getspecific failed\n", 19);
+         xwrite (2, "getspecific failed\n", 19);
          _exit (1);
        }
 
       if (pthread_key_delete (keys[i]) != 0)
        {
-         write (2, "key_delete failed\n", 18);
+         xwrite (2, "key_delete failed\n", 18);
          _exit (1);
        }
     }
@@ -74,13 +75,13 @@ do_test (void)
   /* Now it must be once again possible to allocate keys.  */
   if (pthread_key_create (&keys[0], NULL) != 0)
     {
-      write (2, "2nd key_create failed\n", 22);
+      xwrite (2, "2nd key_create failed\n", 22);
       _exit (1);
     }
 
   if (pthread_key_delete (keys[0]) != 0)
     {
-      write (2, "2nd key_delete failed\n", 22);
+      xwrite (2, "2nd key_delete failed\n", 22);
       _exit (1);
     }
 
index d1073e8459f5ae6126cb5cf0f4ec19d4ab96c863..d1082027caec33acb0d8f4d64fcac1bf6d0cf790 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/mman.h>
 #include <sys/wait.h>
 
+#include <support/xunistd.h>
 
 static sigset_t ss;
 static pthread_barrier_t *b;
@@ -105,7 +106,7 @@ do_test (void)
 
   int i;
   for (i = 0; i < 20; ++i)
-    write (fd, "foobar xyzzy", 12);
+    xwrite (fd, "foobar xyzzy", 12);
 
   b = mmap (NULL, sizeof (pthread_barrier_t), PROT_READ | PROT_WRITE,
            MAP_SHARED, fd, 0);
index dfe7d9f64a2b88f9807b741cad40e47e326fb7d3..15b7747877ca182c1be0457a38a8880c722b1b67 100644 (file)
@@ -25,6 +25,7 @@
 #include <sys/wait.h>
 #include <string.h>
 
+#include <support/xunistd.h>
 
 static sigset_t ss;
 static pthread_barrier_t *b;
@@ -111,7 +112,7 @@ do_test (void)
 
   int i;
   for (i = 0; i < 20; ++i)
-    write (fd, "foobar xyzzy", 12);
+    xwrite (fd, "foobar xyzzy", 12);
 
   b = mmap (NULL, sizeof (pthread_barrier_t), PROT_READ | PROT_WRITE,
            MAP_SHARED, fd, 0);
index 47472ab8e12949b6cea01f7765e45e37d8942f19..4cfe0b67dca65ccf3b3025f49670f7c13a1c938d 100644 (file)
@@ -24,6 +24,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 
+#include <support/xunistd.h>
 
 static void
 notify_func1 (union sigval sigval)
@@ -44,7 +45,7 @@ signal_func (int sig)
 {
   static const char text[] = "signal_func\n";
   signal (sig, signal_func);
-  write (STDOUT_FILENO, text, sizeof text - 1);
+  xwrite (STDOUT_FILENO, text, sizeof text - 1);
 }
 
 static void
index 6f2e70a58a85aa772354505f3ec762d6550faad8..6a793e06df9f1d2f347bce59d31fa9cae5e1004b 100644 (file)
@@ -27,6 +27,8 @@
 #include <stdint.h>
 #include <sys/wait.h>
 
+#include <support/xunistd.h>
+
 /* This function is intended to rack up both user and system time.  */
 static void
 chew_cpu (void)
@@ -41,7 +43,7 @@ chew_cpu (void)
       for (int i = 0; i < 100; ++i)
        for (size_t j = 0; j < sizeof buf; ++j)
          buf[j] = 0xbb;
-      write (nullfd, (char *) buf, sizeof buf);
+      xwrite (nullfd, (char *) buf, sizeof buf);
       close (nullfd);
       if (getppid () == 1)
        _exit (2);