According to specification, function fcntl() is a cancellation point only

when cmd argument is F_SETLKW.
This commit is contained in:
David Xu 2010-08-20 04:15:05 +00:00
parent 895051e367
commit 719863239e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=211522

View File

@ -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);
}