diff options
author | kib <kib@FreeBSD.org> | 2015-12-27 00:42:13 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-12-27 00:42:13 +0000 |
commit | 07bab8ce9f2bb2366d7375a733efa740ea62cb04 (patch) | |
tree | 7ce86e078508d3948f048bbe5f3e2f78a0d21fed /lib | |
parent | 6885269fd53f8f58470f0243c006eac9eedf15b2 (diff) | |
download | FreeBSD-src-07bab8ce9f2bb2366d7375a733efa740ea62cb04.zip FreeBSD-src-07bab8ce9f2bb2366d7375a733efa740ea62cb04.tar.gz |
MFC r292510:
Fix lockf(3) cancellation behaviour.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/lockf.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libc/gen/lockf.c b/lib/libc/gen/lockf.c index 2c567ba..c64a347 100644 --- a/lib/libc/gen/lockf.c +++ b/lib/libc/gen/lockf.c @@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$"); #include <fcntl.h> #include <unistd.h> #include "un-namespace.h" +#include "libc_private.h" int lockf(int filedes, int function, off_t size) @@ -62,9 +63,12 @@ lockf(int filedes, int function, off_t size) break; case F_TEST: fl.l_type = F_WRLCK; - if (_fcntl(filedes, F_GETLK, &fl) == -1) + if (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, F_GETLK, &fl) + == -1) return (-1); - if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && fl.l_pid == getpid())) + if (fl.l_type == F_UNLCK || (fl.l_sysid == 0 && + fl.l_pid == getpid())) return (0); errno = EAGAIN; return (-1); @@ -75,5 +79,6 @@ lockf(int filedes, int function, off_t size) /* NOTREACHED */ } - return (_fcntl(filedes, cmd, &fl)); + return (((int (*)(int, int, ...)) + __libc_interposing[INTERPOS_fcntl])(filedes, cmd, &fl)); } |