This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch master updated. glibc-2.24-348-ge0c6851


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".

The branch, master has been updated
       via  e0c6851980806f2a51b37e3e37fc9a48420a4a83 (commit)
       via  d5b38790950533e80d1fc7c79cab4eacef626547 (commit)
      from  06b9e94f797b910da782b4608545e416ec5af1df (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=e0c6851980806f2a51b37e3e37fc9a48420a4a83

commit e0c6851980806f2a51b37e3e37fc9a48420a4a83
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Oct 31 22:09:12 2016 -0200

    Write messages to stdout and use write_message instead of write
    
    Replaces calls to write on file descriptor 2 with calls to write_message,
    which writes to STDOUT_FILENO (1) and properly deals with the return of
    write.

diff --git a/ChangeLog b/ChangeLog
index 8f12ff1..1adc644 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2016-11-07  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
+	* nptl/tst-basic1.c (tf, do_test): Use write_message.
+	* nptl/tst-cleanup1.c (do_test): Likewise.
+	* nptl/tst-cleanup3.c (do_test): Likewise.
+	* nptl/tst-key1.c (do_test): Likewise.
+	* nptl/tst-key2.c (tf, do_test): Likewise.
+	* nptl/tst-key3.c (tf, do_test): Likewise.
+	* nptl/tst-stdio1.c (do_test): Likewise.
+	* nptl/tst-stdio2.c (do_test): Likewise.
+
 	* nptl/tst-kill3.c (handler): Use write_message in place of write.
 	* nptl/tst-kill6.c (handler): Likewise.
 	* nptl/tst-tls2.c (CB): Likewise.
diff --git a/nptl/tst-basic1.c b/nptl/tst-basic1.c
index 8ea4523..72c6234 100644
--- a/nptl/tst-basic1.c
+++ b/nptl/tst-basic1.c
@@ -22,6 +22,11 @@
 #include <sys/types.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static pid_t pid;
 
 static void *
@@ -29,7 +34,7 @@ tf (void *a)
 {
   if (getpid () != pid)
     {
-      write (2, "pid mismatch\n", 13);
+      write_message ("pid mismatch\n");
       _exit (1);
     }
 
@@ -49,7 +54,7 @@ do_test (void)
   for (i = 0; i < N; ++i)
     if (pthread_create (&t[i], NULL, tf, (void *) (long int) (i + 1)) != 0)
       {
-	write (2, "create failed\n", 14);
+	write_message ("create failed\n");
 	_exit (1);
       }
     else
@@ -66,7 +71,7 @@ do_test (void)
 	}
       else if (r != (void *) (long int) (i + 1))
 	{
-	  write (2, "result wrong\n", 13);
+	  write_message ("result wrong\n");
 	  _exit (1);
 	}
       else
@@ -75,7 +80,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-cleanup1.c b/nptl/tst-cleanup1.c
index 82a568b..ef02ef6 100644
--- a/nptl/tst-cleanup1.c
+++ b/nptl/tst-cleanup1.c
@@ -22,6 +22,11 @@
 #include <unistd.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int global;
 
 
@@ -67,7 +72,7 @@ do_test (void)
 
   if (pthread_create (&th, NULL, tf, NULL) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
@@ -93,7 +98,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-cleanup3.c b/nptl/tst-cleanup3.c
index 3c34a1e..c4f51e3 100644
--- a/nptl/tst-cleanup3.c
+++ b/nptl/tst-cleanup3.c
@@ -22,6 +22,11 @@
 #include <unistd.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int global;
 
 
@@ -65,7 +70,7 @@ do_test (void)
 
   if (pthread_create (&th, NULL, tf, NULL) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
@@ -91,7 +96,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key1.c b/nptl/tst-key1.c
index 0ed1787..ac53729 100644
--- a/nptl/tst-key1.c
+++ b/nptl/tst-key1.c
@@ -23,6 +23,11 @@
 #include <unistd.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 int
 do_test (void)
 {
@@ -38,7 +43,7 @@ do_test (void)
   for (i = 0; i < max; ++i)
     if (pthread_key_create (&keys[i], NULL) != 0)
       {
-	write (2, "key_create failed\n", 18);
+	write_message ("key_create failed\n");
 	_exit (1);
       }
     else
@@ -82,7 +87,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key2.c b/nptl/tst-key2.c
index 3142c86..4e6a9c2 100644
--- a/nptl/tst-key2.c
+++ b/nptl/tst-key2.c
@@ -23,6 +23,11 @@
 #define N 2
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int cnt0;
 static void
 f0 (void *p)
@@ -53,7 +58,7 @@ tf (void *arg)
 
   if (pthread_setspecific (*key, (void *) -1l) != 0)
     {
-      write (2, "setspecific failed\n", 19);
+      write_message ("setspecific failed\n");
       _exit (1);
     }
 
@@ -70,45 +75,41 @@ do_test (void)
   for (i = 0; i < N; ++i)
     if (pthread_key_create (&keys[i], fcts[i]) != 0)
       {
-	write (2, "key_create failed\n", 18);
+	write_message ("key_create failed\n");
 	_exit (1);
       }
 
   pthread_t th;
   if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
   if (pthread_join (th, NULL) != 0)
     {
-      write (2, "join failed\n", 12);
+      write_message ("join failed\n");
       _exit (1);
     }
 
   if (cnt0 != 0)
     {
-      write (2, "cnt0 != 0\n", 10);
+      write_message ("cnt0 != 0\n");
       _exit (1);
     }
 
   if (cnt1 != 1)
     {
-      write (2, "cnt1 != 1\n", 10);
+      write_message ("cnt1 != 1\n");
       _exit (1);
     }
 
   for (i = 0; i < N; ++i)
     if (pthread_key_delete (keys[i]) != 0)
       {
-	write (2, "key_delete failed\n", 18);
+	write_message ("key_delete failed\n");
 	_exit (1);
       }
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-key3.c b/nptl/tst-key3.c
index a298569..33d811d 100644
--- a/nptl/tst-key3.c
+++ b/nptl/tst-key3.c
@@ -23,6 +23,11 @@
 #define N 2
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static int cnt0;
 static void
 f0 (void *p)
@@ -56,7 +61,7 @@ tf (void *arg)
 
   if (pthread_setspecific (*key, (void *) -1l) != 0)
     {
-      write (2, "setspecific failed\n", 19);
+      write_message ("setspecific failed\n");
       _exit (1);
     }
 
@@ -80,20 +85,20 @@ do_test (void)
   for (i = 0; i < N; ++i)
     if (pthread_key_create (&keys[i], fcts[i]) != 0)
       {
-	write (2, "key_create failed\n", 18);
+	write_message ("key_create failed\n");
 	_exit (1);
       }
 
   if (pthread_barrier_init (&b, NULL, 2) != 0)
     {
-      write (2, "barrier_init failed\n", 20);
+      write_message ("barrier_init failed\n");
       _exit (1);
     }
 
   pthread_t th;
   if (pthread_create (&th, NULL, tf, &keys[1]) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
@@ -101,20 +106,20 @@ do_test (void)
 
   if (pthread_cancel (th) != 0)
     {
-      write (2, "cancel failed\n", 14);
+      write_message ("cancel failed\n");
       _exit (1);
     }
 
   void *status;
   if (pthread_join (th, &status) != 0)
     {
-      write (2, "join failed\n", 12);
+      write_message ("join failed\n");
       _exit (1);
     }
 
   if (status != PTHREAD_CANCELED)
     {
-      write (2, "thread not canceled\n", 20);
+      write_message ("thread not canceled\n");
       _exit (1);
     }
 
@@ -124,32 +129,28 @@ do_test (void)
      have run and therefore these tests succeed.  */
   if (cnt0 != 0)
     {
-      write (2, "cnt0 != 0\n", 10);
+      write_message ("cnt0 != 0\n");
       _exit (1);
     }
 
   if (cnt1 != 1)
     {
-      write (2, "cnt1 != 1\n", 10);
+      write_message ("cnt1 != 1\n");
       _exit (1);
     }
 
   for (i = 0; i < N; ++i)
     if (pthread_key_delete (keys[i]) != 0)
       {
-	write (2, "key_delete failed\n", 18);
+	write_message ("key_delete failed\n");
 	_exit (1);
       }
 
   if (pthread_barrier_destroy (&b) != 0)
     {
-      write (2, "barrier_destroy failed\n", 23);
+      write_message ("barrier_destroy failed\n");
       _exit (1);
     }
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-stdio1.c b/nptl/tst-stdio1.c
index 4250e53..7432261 100644
--- a/nptl/tst-stdio1.c
+++ b/nptl/tst-stdio1.c
@@ -43,7 +43,7 @@ do_test (void)
 
   if (pthread_create (&th, NULL, tf, NULL) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
diff --git a/nptl/tst-stdio2.c b/nptl/tst-stdio2.c
index 6168d27..e0148c9 100644
--- a/nptl/tst-stdio2.c
+++ b/nptl/tst-stdio2.c
@@ -23,6 +23,11 @@
 #include <unistd.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static void *tf (void *a)
 {
   puts ("start tf");
@@ -55,7 +60,7 @@ do_test (void)
 
   if (pthread_create (&th, NULL, tf, NULL) != 0)
     {
-      write (2, "create failed\n", 14);
+      write_message ("create failed\n");
       _exit (1);
     }
 
@@ -75,7 +80,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d5b38790950533e80d1fc7c79cab4eacef626547

commit d5b38790950533e80d1fc7c79cab4eacef626547
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Sun Oct 30 23:51:27 2016 -0200

    Use write_message instead of write
    
    In the test cases, there are writes to stdout which do not check the result
    value.  This patch replaces such occurrences with calls to write_message,
    which properly deals with the unused result.
    
    Tested for powerpc64le.

diff --git a/ChangeLog b/ChangeLog
index 18d74ba..8f12ff1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-07  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	* nptl/tst-kill3.c (handler): Use write_message in place of write.
+	* nptl/tst-kill6.c (handler): Likewise.
+	* nptl/tst-tls2.c (CB): Likewise.
+	* nptl/tst-tls3.c (CB): Likewise.
+
 2016-11-07  Joseph Myers  <joseph@codesourcery.com>
 
 	* scripts/check-installed-headers.sh: Ignore sys/sysctl.h for x32.
diff --git a/nptl/tst-kill3.c b/nptl/tst-kill3.c
index 308cc5a..86f3c6c 100644
--- a/nptl/tst-kill3.c
+++ b/nptl/tst-kill3.c
@@ -25,6 +25,12 @@
 #include <sys/time.h>
 
 
+static int do_test (void);
+
+#define TIMEOUT 5
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static pthread_cond_t c = PTHREAD_COND_INITIALIZER;
 static pthread_mutex_t m = PTHREAD_MUTEX_INITIALIZER;
 static pthread_barrier_t b;
@@ -33,7 +39,7 @@ static pthread_barrier_t b;
 static void
 handler (int sig)
 {
-  write (1, "handler called\n", 15);
+  write_message ("handler called\n");
   _exit (1);
 }
 
@@ -151,8 +157,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TIMEOUT 5
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-kill6.c b/nptl/tst-kill6.c
index 80a0771..2a9add2 100644
--- a/nptl/tst-kill6.c
+++ b/nptl/tst-kill6.c
@@ -25,6 +25,11 @@
 #include <unistd.h>
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 static pthread_t receiver;
 static sem_t sem;
 static pthread_barrier_t b;
@@ -34,19 +39,19 @@ handler (int sig)
 {
   if (sig != SIGUSR1)
     {
-      write (STDOUT_FILENO, "wrong signal\n", 13);
+      write_message ("wrong signal\n");
       _exit (1);
     }
 
   if (pthread_self () != receiver)
     {
-      write (STDOUT_FILENO, "not the intended receiver\n", 26);
+      write_message ("not the intended receiver\n");
       _exit (1);
     }
 
   if (sem_post (&sem) != 0)
     {
-      write (STDOUT_FILENO, "sem_post failed\n", 16);
+      write_message ("sem_post failed\n");
       _exit (1);
     }
 }
@@ -155,7 +160,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-tls2.c b/nptl/tst-tls2.c
index eb6d8a3..054ab80 100644
--- a/nptl/tst-tls2.c
+++ b/nptl/tst-tls2.c
@@ -29,13 +29,18 @@
 static pthread_t th[N];
 
 
+static int do_test (void);
+
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #define CB(n) \
 static void								      \
 cb##n (void)								      \
 {									      \
   if (th[n] != pthread_self ())						      \
     {									      \
-      write (STDOUT_FILENO, "wrong callback\n", 15);			      \
+      write_message ("wrong callback\n");				      \
       _exit (1);							      \
     }									      \
 }
@@ -67,7 +72,7 @@ handler (int sig)
 {
   if (sig != THE_SIG)
     {
-      write (STDOUT_FILENO, "wrong signal\n", 13);
+      write_message ("wrong signal\n");
       _exit (1);
     }
 
@@ -75,7 +80,7 @@ handler (int sig)
 
   if (sem_post (&s) != 0)
     {
-      write (STDOUT_FILENO, "sem_post failed\n", 16);
+      write_message ("sem_post failed\n");
       _exit (1);
     }
 }
@@ -199,7 +204,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
diff --git a/nptl/tst-tls3.c b/nptl/tst-tls3.c
index 649cb8f..4b96974 100644
--- a/nptl/tst-tls3.c
+++ b/nptl/tst-tls3.c
@@ -39,13 +39,19 @@ static long stack_size_in_mb;
 static pthread_t th[N];
 
 
+static int do_test (void);
+
+#define TIMEOUT 5
+#define TEST_FUNCTION do_test ()
+#include "../test-skeleton.c"
+
 #define CB(n) \
 static void								      \
 cb##n (void)								      \
 {									      \
   if (th[n] != pthread_self ())						      \
     {									      \
-      write (STDOUT_FILENO, "wrong callback\n", 15);			      \
+      write_message ("wrong callback\n");				      \
       _exit (1);							      \
     }									      \
 }
@@ -207,8 +213,3 @@ do_test (void)
 
   return 0;
 }
-
-
-#define TIMEOUT 5
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog           |   16 ++++++++++++++++
 nptl/tst-basic1.c   |   15 ++++++++-------
 nptl/tst-cleanup1.c |   11 ++++++-----
 nptl/tst-cleanup3.c |   11 ++++++-----
 nptl/tst-key1.c     |   11 ++++++-----
 nptl/tst-key2.c     |   23 ++++++++++++-----------
 nptl/tst-key3.c     |   31 ++++++++++++++++---------------
 nptl/tst-kill3.c    |   13 +++++++------
 nptl/tst-kill6.c    |   15 ++++++++-------
 nptl/tst-stdio1.c   |    2 +-
 nptl/tst-stdio2.c   |   11 ++++++-----
 nptl/tst-tls2.c     |   15 ++++++++-------
 nptl/tst-tls3.c     |   13 +++++++------
 13 files changed, 107 insertions(+), 80 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]