summaryrefslogtreecommitdiffstats
path: root/regress/lib/libpthread/cancel/cancel.c
diff options
context:
space:
mode:
Diffstat (limited to 'regress/lib/libpthread/cancel/cancel.c')
-rw-r--r--regress/lib/libpthread/cancel/cancel.c7
1 files changed, 4 insertions, 3 deletions
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) {