summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2016-09-20 17:04:36 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2016-09-20 17:04:36 +0000
commit71f8a06567d506d560bbcc06456ef29613775e72 (patch)
treee440e0d21bb98aa643411c92f96c797462f8fa2b /regress/lib
parentf300ecb05a253eff30f1d94c0b83806bb8b811ff (diff)
don't depend on /dev/tty, in bluhm's framework there is no such thing
use openpty(3) instead
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libpthread/cancel/Makefile4
-rw-r--r--regress/lib/libpthread/cancel/cancel.c7
-rw-r--r--regress/lib/libpthread/poll/Makefile4
-rw-r--r--regress/lib/libpthread/poll/poll.c7
4 files changed, 12 insertions, 10 deletions
diff --git a/regress/lib/libpthread/cancel/Makefile b/regress/lib/libpthread/cancel/Makefile
index de275c5e13a..d2d668be7c3 100644
--- a/regress/lib/libpthread/cancel/Makefile
+++ b/regress/lib/libpthread/cancel/Makefile
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile,v 1.2 2002/01/03 00:43:47 art Exp $
+# $OpenBSD: Makefile,v 1.3 2016/09/20 17:04:34 otto Exp $
PROG= cancel
-
+LDADD= -lutil
.include <bsd.regress.mk>
diff --git a/regress/lib/libpthread/cancel/cancel.c b/regress/lib/libpthread/cancel/cancel.c
index 9ff11818c9e..cd68116b285 100644
--- a/regress/lib/libpthread/cancel/cancel.c
+++ b/regress/lib/libpthread/cancel/cancel.c
@@ -1,9 +1,10 @@
-/* $OpenBSD: cancel.c,v 1.7 2013/10/06 21:46:10 guenther Exp $ */
+/* $OpenBSD: cancel.c,v 1.8 2016/09/20 17:04:34 otto Exp $ */
/* David Leonard <d@openbsd.org>, 1999. Public Domain. */
#include <pthread.h>
#include <pthread_np.h>
#include <unistd.h>
+#include <util.h>
#include <stdio.h>
#include <fcntl.h>
#include <stdlib.h>
@@ -49,14 +50,14 @@ c1handler(void *arg)
static void *
child1fn(void *arg)
{
- int fd;
+ int fd, dummy;
char buf[1024];
int len;
SET_NAME("c1");
CHECKr(pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL));
/* something that will block */
- CHECKe(fd = open("/dev/tty", O_RDONLY));
+ CHECKe(openpty(&fd, &dummy, NULL, NULL, NULL));
pthread_cleanup_push(c1handler, (void *)&fd);
v();
while (1) {
diff --git a/regress/lib/libpthread/poll/Makefile b/regress/lib/libpthread/poll/Makefile
index 6a0229ac6c7..a1944b0f5ca 100644
--- a/regress/lib/libpthread/poll/Makefile
+++ b/regress/lib/libpthread/poll/Makefile
@@ -1,5 +1,5 @@
-# $OpenBSD: Makefile,v 1.2 2002/01/03 00:43:47 art Exp $
+# $OpenBSD: Makefile,v 1.3 2016/09/20 17:04:35 otto Exp $
PROG= poll
-
+LDADD= -lutil
.include <bsd.regress.mk>
diff --git a/regress/lib/libpthread/poll/poll.c b/regress/lib/libpthread/poll/poll.c
index 4b76bd7d858..979d2916d9a 100644
--- a/regress/lib/libpthread/poll/poll.c
+++ b/regress/lib/libpthread/poll/poll.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: poll.c,v 1.4 2003/07/31 21:48:05 deraadt Exp $ */
+/* $OpenBSD: poll.c,v 1.5 2016/09/20 17:04:35 otto Exp $ */
/* David Leonard <d@openbsd.org>, 2001. Public Domain. */
#include <pthread.h>
@@ -7,6 +7,7 @@
#include <paths.h>
#include <unistd.h>
#include <stdlib.h>
+#include <util.h>
#include "test.h"
@@ -54,7 +55,7 @@ main(int argc, char *argv[])
{
pthread_t t;
void *result;
- int null, zero, tty;
+ int null, zero, tty, dummy;
int tube[2];
struct pollfd p[3];
@@ -63,7 +64,7 @@ main(int argc, char *argv[])
CHECKe(zero = open(_PATH_DEV "zero", O_RDONLY));
CHECKe(null = open(_PATH_DEV "null", O_WRONLY));
- CHECKe(tty = open(_PATH_DEV "tty", O_WRONLY));
+ CHECKe(openpty(&tty, &dummy, NULL, NULL, NULL));
/* Try both descriptors being ready */
p[0].fd = zero;