diff options
author | David Leonard <d@cvs.openbsd.org> | 1999-06-09 07:16:18 +0000 |
---|---|---|
committer | David Leonard <d@cvs.openbsd.org> | 1999-06-09 07:16:18 +0000 |
commit | 5b25504c910ae952393636884728bb911ccd8733 (patch) | |
tree | 883d88f07de3449ef2ca038b75c007b57ce95e3d /lib/libc_r/uthread/uthread_fsync.c | |
parent | 26ab430a80ba9c64b06a358f6b69d491a912f54a (diff) |
document cancellation point handling a bit better
Diffstat (limited to 'lib/libc_r/uthread/uthread_fsync.c')
-rw-r--r-- | lib/libc_r/uthread/uthread_fsync.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_fsync.c b/lib/libc_r/uthread/uthread_fsync.c index 9db34f5564c..2136d62afe7 100644 --- a/lib/libc_r/uthread/uthread_fsync.c +++ b/lib/libc_r/uthread/uthread_fsync.c @@ -29,7 +29,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: uthread_fsync.c,v 1.3 1999/01/17 23:57:27 d Exp $ + * $OpenBSD: uthread_fsync.c,v 1.4 1999/06/09 07:16:17 d Exp $ */ #include <unistd.h> #ifdef _THREAD_SAFE @@ -41,12 +41,17 @@ fsync(int fd) { int ret; + /* This is a cancellation point: */ _thread_enter_cancellation_point(); + if ((ret = _FD_LOCK(fd, FD_RDWR, NULL)) == 0) { ret = _thread_sys_fsync(fd); _FD_UNLOCK(fd, FD_RDWR); } + + /* No longer in a cancellation point: */ _thread_leave_cancellation_point(); + return (ret); } #endif |