diff options
Diffstat (limited to 'regress/lib/libc_r/cancel/cancel.c')
-rw-r--r-- | regress/lib/libc_r/cancel/cancel.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/regress/lib/libc_r/cancel/cancel.c b/regress/lib/libc_r/cancel/cancel.c index 2dd0d4c1940..be344ba7731 100644 --- a/regress/lib/libc_r/cancel/cancel.c +++ b/regress/lib/libc_r/cancel/cancel.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cancel.c,v 1.1 2001/08/15 14:37:10 fgsch Exp $ */ +/* $OpenBSD: cancel.c,v 1.2 2001/08/23 04:26:05 fgsch Exp $ */ /* David Leonard <d@openbsd.org>, 1999. Public Domain. */ #include <pthread.h> @@ -34,9 +34,9 @@ void v() { } void -c1handler(void *fd) +c1handler(void *arg) { - CHECKe(close((int)fd)); + CHECKe(close(*(int *)arg)); v(); } @@ -52,7 +52,7 @@ child1fn(arg) CHECKr(pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, NULL)); /* something that will block */ CHECKe(fd = open("/dev/tty", O_RDONLY)); - pthread_cleanup_push(c1handler, (void *)fd); + pthread_cleanup_push(c1handler, (void *)&fd); v(); while (1) { CHECKe(len = read(fd, &buf, sizeof buf)); |