about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-18 22:25:33 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-18 22:25:33 +0000
commitca343e73586cd05cb39e8fa884637d804558bf4c (patch)
treedcdd2ee3bde920df734fb75e435432ccb3799de9 /nptl
parent50441a984d7123d6d5708ceea1718c7229e747cf (diff)
downloadglibc-ca343e73586cd05cb39e8fa884637d804558bf4c.tar.gz
glibc-ca343e73586cd05cb39e8fa884637d804558bf4c.tar.xz
glibc-ca343e73586cd05cb39e8fa884637d804558bf4c.zip
Update.
	* tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
	find a random value.
	(tf_msgrcv): Likewise.  Also don't report msgrcv returns if
	errno==EIDRM.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog5
-rw-r--r--nptl/tst-cancel4.c17
2 files changed, 20 insertions, 2 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 846ebf057d..d3221e81f9 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,10 @@
 2003-06-18  Ulrich Drepper  <drepper@redhat.com>
 
+	* tst-cancel4.c (tf_msgsnd): Don't always use 100 as the type,
+	find a random value.
+	(tf_msgrcv): Likewise.  Also don't report msgrcv returns if
+	errno==EIDRM.
+
 	* sysdeps/unix/sysv/linux/timer_settime.c: Add prototype for
 	compat_timer_settime.
 	* sysdeps/unix/sysv/linux/timer_gettime.c: Add prototype for
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index d729de6384..8b0b735ada 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -1898,7 +1898,17 @@ tf_msgrcv (void *arg)
     long int type;
     char mem[10];
   } m;
-  msgrcv (tempmsg, (struct msgbuf *) &m, 10, 100, 0);
+  int randnr;
+  /* We need a positive random number.  */
+  do
+    randnr = random ();
+  while (randnr <= 0);
+  do
+    {
+      errno = 0;
+      msgrcv (tempmsg, (struct msgbuf *) &m, 10, randnr, 0);
+    }
+  while (errno == EIDRM);
 
   pthread_cleanup_pop (0);
 
@@ -1939,7 +1949,10 @@ tf_msgsnd (void *arg)
     long int type;
     char mem[1];
   } m;
-  m.type = 100;
+  /* We need a positive random number.  */
+  do
+    m.type = random ();
+  while (m.type <= 0);
   msgsnd (tempmsg, (struct msgbuf *) &m, sizeof (m.mem), 0);
 
   pthread_cleanup_pop (0);