diff options
Diffstat (limited to 'lib/libpthread/uthread/uthread_sendto.c')
-rw-r--r-- | lib/libpthread/uthread/uthread_sendto.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libpthread/uthread/uthread_sendto.c b/lib/libpthread/uthread/uthread_sendto.c index 062d11e77ac..c2ad04b0e2a 100644 --- a/lib/libpthread/uthread/uthread_sendto.c +++ b/lib/libpthread/uthread/uthread_sendto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uthread_sendto.c,v 1.5 2001/08/21 19:24:53 fgsch Exp $ */ +/* $OpenBSD: uthread_sendto.c,v 1.6 2003/12/23 19:31:05 brad Exp $ */ /* * Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au> * All rights reserved. @@ -46,6 +46,9 @@ sendto(int fd, const void *msg, size_t len, int flags, const struct sockaddr * t struct pthread *curthread = _get_curthread(); int ret; + /* This is a cancellation point: */ + _thread_enter_cancellation_point(); + if ((ret = _FD_LOCK(fd, FD_WRITE, NULL)) == 0) { while ((ret = _thread_sys_sendto(fd, msg, len, flags, to, to_len)) < 0) { if (!(_thread_fd_table[fd]->flags & O_NONBLOCK) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) { @@ -69,6 +72,10 @@ sendto(int fd, const void *msg, size_t len, int flags, const struct sockaddr * t } _FD_UNLOCK(fd, FD_WRITE); } + + /* No longer in a cancellation point: */ + _thread_leave_cancellation_point(); + return (ret); } #endif |