]> sourceware.org Git - glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 26 May 2000 20:49:00 +0000 (20:49 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 26 May 2000 20:49:00 +0000 (20:49 +0000)
* posix/tst-preadwrite.c: Allow parallel execution of
tst-preadwrite and tst-preadwrite64.

ChangeLog
posix/tst-preadwrite.c
posix/tst-truncate.c

index 52771ad65df252b7730acad1892eb26357b506a5..906df1204c30fa69c1ae5eea2dfe9ea7f35460e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2000-05-26  Ulrich Drepper  <drepper@redhat.com>
 
+       * posix/tst-preadwrite.c: Allow parallel execution of
+       tst-preadwrite and tst-preadwrite64.
+
        * posix/Makefile (tests): Add tst-truncate and tst-truncate64.
        * posix/tst-truncate.c: New file.
        * posix/tst-truncate64.c: New file.
index 6a71e4f5d5fc6d322790427cc8efb0cc862258ea..d1dcdcc67cea61e799bf15205355ba6dc7c195a0 100644 (file)
@@ -54,16 +54,18 @@ do_prepare (int argc, char *argv[])
 {
    char name_len;
 
-     name_len = strlen (test_dir);
-     name = malloc (name_len + sizeof ("/preadwriteXXXXXX"));
-     mempcpy (mempcpy (name, test_dir, name_len),
-             "/preadwriteXXXXXX", sizeof ("/preadwriteXXXXXX"));
-     add_temp_file (name);
-
-     /* Open our test file.   */
-     fd = mkstemp (name);
-     if (fd == -1)
-       error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
+#define FNAME FNAME2(TRUNCATE)
+#define FNAME2(s) "/" STRINGIFY(s) "XXXXXX"
+
+   name_len = strlen (test_dir);
+   name = malloc (name_len + sizeof (FNAME));
+   mempcpy (mempcpy (name, test_dir, name_len), FNAME, sizeof (FNAME));
+   add_temp_file (name);
+
+   /* Open our test file.   */
+   fd = mkstemp (name);
+   if (fd == -1)
+     error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
 }
 
 
index fa964f5f334628c58db1d418f3ab185cc2dcfc98..663f0e4a9ff07aeb01174c1983529902b1847cc6 100644 (file)
@@ -55,16 +55,18 @@ do_prepare (int argc, char *argv[])
 {
    char name_len;
 
-     name_len = strlen (test_dir);
-     name = malloc (name_len + sizeof ("/truncateXXXXXX"));
-     mempcpy (mempcpy (name, test_dir, name_len),
-             "/truncateXXXXXX", sizeof ("/truncateXXXXXX"));
-     add_temp_file (name);
-
-     /* Open our test file.   */
-     fd = mkstemp (name);
-     if (fd == -1)
-       error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
+#define FNAME FNAME2(TRUNCATE)
+#define FNAME2(s) "/" STRINGIFY(s) "XXXXXX"
+
+   name_len = strlen (test_dir);
+   name = malloc (name_len + sizeof (FNAME));
+   mempcpy (mempcpy (name, test_dir, name_len), FNAME, sizeof (FNAME));
+   add_temp_file (name);
+
+   /* Open our test file.   */
+   fd = mkstemp (name);
+   if (fd == -1)
+     error (EXIT_FAILURE, errno, "cannot open test file `%s'", name);
 }
 
 
@@ -73,7 +75,6 @@ do_test (int argc, char *argv[])
 {
   struct stat st;
   char buf[1000];
-  int i;
 
   memset (buf, '\0', sizeof (buf));
 
@@ -85,35 +86,43 @@ do_test (int argc, char *argv[])
 
 
   if (FTRUNCATE (fd, 800) < 0)
-    error (EXIT_FAILURE, errno, "size reduction with ftruncate failed");
+    error (EXIT_FAILURE, errno, "size reduction with %s failed",
+          STRINGIFY (FTRUNCATE));
 
   if (fstat (fd, &st) < 0 || st.st_size != 800)
-    error (EXIT_FAILURE, 0, "size after reduction with ftruncate incorrect");
+    error (EXIT_FAILURE, 0, "size after reduction with %s incorrect",
+          STRINGIFY (FTRUNCATE));
 
   /* The following test covers more than POSIX.  POSIX does not require
      that ftruncate() can increase the file size.  But we are testing
      Unix systems.  */
   if (FTRUNCATE (fd, 1200) < 0)
-    error (EXIT_FAILURE, errno, "size increase with ftruncate failed");
+    error (EXIT_FAILURE, errno, "size increase with %s failed",
+          STRINGIFY (FTRUNCATE));
 
   if (fstat (fd, &st) < 0 || st.st_size != 1200)
-    error (EXIT_FAILURE, 0, "size after increase with ftruncate incorrect");
+    error (EXIT_FAILURE, 0, "size after increase with %s incorrect",
+          STRINGIFY (FTRUNCATE));
 
 
   if (TRUNCATE (name, 800) < 0)
-    error (EXIT_FAILURE, errno, "size reduction with truncate failed");
+    error (EXIT_FAILURE, errno, "size reduction with %s failed",
+          STRINGIFY (TRUNCATE));
 
   if (fstat (fd, &st) < 0 || st.st_size != 800)
-    error (EXIT_FAILURE, 0, "size after reduction with truncate incorrect");
+    error (EXIT_FAILURE, 0, "size after reduction with %s incorrect",
+          STRINGIFY (TRUNCATE));
 
   /* The following test covers more than POSIX.  POSIX does not require
      that truncate() can increase the file size.  But we are testing
      Unix systems.  */
   if (TRUNCATE (name, 1200) < 0)
-    error (EXIT_FAILURE, errno, "size increase with truncate failed");
+    error (EXIT_FAILURE, errno, "size increase with %s failed",
+          STRINGIFY (TRUNCATE));
 
   if (fstat (fd, &st) < 0 || st.st_size != 1200)
-    error (EXIT_FAILURE, 0, "size after increase with truncate incorrect");
+    error (EXIT_FAILURE, 0, "size after increase with %s incorrect",
+          STRINGIFY (TRUNCATE));
 
 
   close (fd);
This page took 0.050104 seconds and 5 git commands to generate.