aboutsummaryrefslogtreecommitdiff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2003-06-27 17:53:52 +0000
committerUlrich Drepper <drepper@redhat.com>2003-06-27 17:53:52 +0000
commit483e95d09b01e518808eb89de0140a8dc1ce1c2c (patch)
tree05182ed6bd1643342ff8b4757a674d17b5f941d1 /nptl
parent7d7ff54cb9152548227f42e1cf7336447f48ec2a (diff)
downloadglibc-483e95d09b01e518808eb89de0140a8dc1ce1c2c.zip
glibc-483e95d09b01e518808eb89de0140a8dc1ce1c2c.tar.gz
glibc-483e95d09b01e518808eb89de0140a8dc1ce1c2c.tar.bz2
Update.
* tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call. (tf_msgsnd): Likewise.
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog3
-rw-r--r--nptl/tst-cancel4.c13
2 files changed, 12 insertions, 4 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 65cf4ef..072b009 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,5 +1,8 @@
2003-06-27 Ulrich Drepper <drepper@redhat.com>
+ * tst-cancel4.c (tf_msgrcv): Use IPC_PRIVATE in msgget call.
+ (tf_msgsnd): Likewise.
+
* tst-cancel4.c (tf_msgrcv): Strengthen test against valid
premature returns a bit more.
diff --git a/nptl/tst-cancel4.c b/nptl/tst-cancel4.c
index a8142d9..19e1baf 100644
--- a/nptl/tst-cancel4.c
+++ b/nptl/tst-cancel4.c
@@ -80,6 +80,10 @@ static int tempmsg = -1;
static pthread_barrier_t b2;
+#ifndef IPC_ADDVAL
+# define IPC_ADDVAL 0
+#endif
+
/* Cleanup handling test. */
static int cl_called;
@@ -90,6 +94,7 @@ cl (void *arg)
}
+
static void *
tf_read (void *arg)
{
@@ -1872,7 +1877,7 @@ tf_tcdrain (void *arg)
static void *
tf_msgrcv (void *arg)
{
- tempmsg = msgget (random (), 0666 | IPC_CREAT);
+ tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
int r = pthread_barrier_wait (&b2);
if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
@@ -1903,7 +1908,7 @@ tf_msgrcv (void *arg)
int randnr;
/* We need a positive random number. */
do
- randnr = random ();
+ randnr = random () % 64000;
while (randnr <= 0);
do
{
@@ -1928,7 +1933,7 @@ tf_msgsnd (void *arg)
// blocks we can enable this test to run in both rounds.
abort ();
- tempmsg = msgget (random (), 0666 | IPC_CREAT);
+ tempmsg = msgget (IPC_PRIVATE, 0666 | IPC_CREAT);
int r = pthread_barrier_wait (&b2);
if (r != 0 && r != PTHREAD_BARRIER_SERIAL_THREAD)
@@ -1953,7 +1958,7 @@ tf_msgsnd (void *arg)
} m;
/* We need a positive random number. */
do
- m.type = random ();
+ m.type = random () % 64000;
while (m.type <= 0);
msgsnd (tempmsg, (struct msgbuf *) &m, sizeof (m.mem), 0);