summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2010-08-20 04:15:05 +0000
committerdavidxu <davidxu@FreeBSD.org>2010-08-20 04:15:05 +0000
commit07b66dcf06596326ea9d81d40d460bdef6f50b34 (patch)
treecf8bdfdac52ea429afdeebb57191e4bb6a7f8c16 /lib
parentf701502ad82ea0365dcafab8c7689356c2e5435c (diff)
downloadFreeBSD-src-07b66dcf06596326ea9d81d40d460bdef6f50b34.zip
FreeBSD-src-07b66dcf06596326ea9d81d40d460bdef6f50b34.tar.gz
According to specification, function fcntl() is a cancellation point only
when cmd argument is F_SETLKW.
Diffstat (limited to 'lib')
-rw-r--r--lib/libthr/thread/thr_syscalls.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/libthr/thread/thr_syscalls.c b/lib/libthr/thread/thr_syscalls.c
index 92670a9..ad3f091 100644
--- a/lib/libthr/thread/thr_syscalls.c
+++ b/lib/libthr/thread/thr_syscalls.c
@@ -242,8 +242,6 @@ __fcntl(int fd, int cmd,...)
int ret;
va_list ap;
- _thr_cancel_enter(curthread);
-
va_start(ap, cmd);
switch (cmd) {
case F_DUPFD:
@@ -257,6 +255,17 @@ __fcntl(int fd, int cmd,...)
case F_GETFL:
ret = __sys_fcntl(fd, cmd);
break;
+
+ case F_OSETLKW:
+ case F_SETLKW:
+ _thr_cancel_enter(curthread);
+#ifdef SYSCALL_COMPAT
+ ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
+#else
+ ret = __sys_fcntl(fd, cmd, va_arg(ap, void *));
+#endif
+ _thr_cancel_leave(curthread);
+ break;
default:
#ifdef SYSCALL_COMPAT
ret = __fcntl_compat(fd, cmd, va_arg(ap, void *));
@@ -266,8 +275,6 @@ __fcntl(int fd, int cmd,...)
}
va_end(ap);
- _thr_cancel_leave(curthread);
-
return (ret);
}
OpenPOWER on IntegriCloud