diff options
author | Renato Botelho <renato@netgate.com> | 2015-12-28 07:46:42 -0200 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-12-28 07:46:42 -0200 |
commit | 0319542cc712df59c57f014b4f925f516bcb5b4b (patch) | |
tree | d471c26ca5a9ed2a730a1bbb6781f4e08c79a939 /lib/libc/gen/lockf.c | |
parent | 3f9b44b7cebbdee8202dd56d8c57ac81b13114e1 (diff) | |
parent | 70f106975f9e06a5c50c4dfa06fb3b3d41d1780f (diff) | |
download | FreeBSD-src-0319542cc712df59c57f014b4f925f516bcb5b4b.zip FreeBSD-src-0319542cc712df59c57f014b4f925f516bcb5b4b.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libc/gen/lockf.c')
-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)); } |