public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tst-cond12.c
@ 2003-11-21 15:31 Jakub Jelinek
  2003-11-21 22:43 ` Ulrich Drepper
  0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2003-11-21 15:31 UTC (permalink / raw)
  To: Ulrich Drepper, Roland McGrath; +Cc: Glibc hackers

Hi!

tst-cond13.c defines USE_COND_SIGNAL but nothing was using that define.
Also, there were warnings because add_temp_file was used without prototype.
This patch also has an unrelated change which I had in my tree
(tst-cleanup4aux.c not in distribute).

2003-11-21  Jakub Jelinek  <jakub@redhat.com>

	* Makefile (distribute): tst-cleanup4aux.c.

	* tst-cond12.c (prepare): Add prototype.  Move after test-skeleton.c
	include.
	(do_test): If USE_COND_SIGNAL is defined, use pthread_cond_signal
	instead of pthread_cond_broadcast.

--- libc/nptl/Makefile.jj	2003-11-21 12:14:18.000000000 +0100
+++ libc/nptl/Makefile	2003-11-21 12:01:34.000000000 +0100
@@ -234,7 +234,7 @@ tests = tst-attr1 tst-attr2 tst-attr3 \
 	tst-context1 \
 	tst-sched1
 
-distribute = eintr.c
+distribute = eintr.c tst-cleanup4aux.c
 
 gen-as-const-headers = pthread-errnos.sym
 
--- libc/nptl/tst-cond12.c.jj	2003-11-21 10:19:51.000000000 +0100
+++ libc/nptl/tst-cond12.c	2003-11-21 12:21:55.000000000 +0100
@@ -30,6 +30,13 @@
 static char fname[] = "/tmp/tst-cond12-XXXXXX";
 static int fd;
 
+static void prepare (void);
+#define PREPARE(argc, argv) prepare ()
+
+static int do_test (void);
+#define TEST_FUNCTION do_test ()
+
+#include "../test-skeleton.c"
 
 static void
 prepare (void)
@@ -47,13 +54,6 @@ prepare (void)
       exit (1);
     }
 }
-#define PREPARE(argc, argv) prepare ()
-
-
-static int do_test (void);
-#define TEST_FUNCTION do_test ()
-#include "../test-skeleton.c"
-
 
 static int
 do_test (void)
@@ -152,12 +152,21 @@ do_test (void)
 
       p->var = 0;
 
+#ifdef USE_COND_SIGNAL
+      if (pthread_cond_signal (&p->c) != 0)
+	{
+	  puts ("child: cond_broadcast failed");
+	  kill (getppid (), SIGKILL);
+	  exit (1);
+	}
+#else
       if (pthread_cond_broadcast (&p->c) != 0)
 	{
 	  puts ("child: cond_broadcast failed");
 	  kill (getppid (), SIGKILL);
 	  exit (1);
 	}
+#endif
 
       if (pthread_mutex_unlock (&p->m) != 0)
 	{

	Jakub

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix tst-cond12.c
  2003-11-21 15:31 [PATCH] Fix tst-cond12.c Jakub Jelinek
@ 2003-11-21 22:43 ` Ulrich Drepper
  0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2003-11-21 22:43 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Glibc hackers

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jakub Jelinek wrote:

> tst-cond13.c defines USE_COND_SIGNAL but nothing was using that define.

Missing commit.  I fixed that.


> Also, there were warnings because add_temp_file was used without prototype.

I've applied the rest of the patch.  Thanks,

- -- 
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/vl9D2ijCOnn/RHQRAj0HAJ4nmkLZVF4k/06RcNZRx5jr8ICVTwCeLNh2
rTm9jIndFRvG4jsvg46VJsU=
=h8EM
-----END PGP SIGNATURE-----

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-11-21 18:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-21 15:31 [PATCH] Fix tst-cond12.c Jakub Jelinek
2003-11-21 22:43 ` Ulrich Drepper

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).