diff options
author | Florin Coras <fcoras@cisco.com> | 2020-05-26 19:45:45 +0000 |
---|---|---|
committer | Andrew Yourtchenko <ayourtch@gmail.com> | 2020-05-27 11:23:34 +0000 |
commit | 449f34e2f33103fe6386299a30cd573626391a94 (patch) | |
tree | e0d654eea07c153fa7a592e71d32fbfe51d71163 /src/vcl/ldp.c | |
parent | e2e3c38be6d91c3deb15373992cd5a764e773060 (diff) |
vcl: fix ldp fcntl64
Type: fix
Ticket: VPP-1882
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I342d8f928fcc7de74f9bd288c1a5d63ea1f90020
(cherry picked from commit 0ab36f55753d3d1417c41f8a3aec5e79a882555c)
Diffstat (limited to 'src/vcl/ldp.c')
-rw-r--r-- | src/vcl/ldp.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/src/vcl/ldp.c b/src/vcl/ldp.c index 091c7e5cff4..8492f020bf5 100644 --- a/src/vcl/ldp.c +++ b/src/vcl/ldp.c @@ -477,17 +477,11 @@ writev (int fd, const struct iovec * iov, int iovcnt) return size; } -int -fcntl (int fd, int cmd, ...) +static int +fcntl_internal (int fd, int cmd, va_list ap) { vls_handle_t vlsh; int rv = 0; - va_list ap; - - if ((errno = -ldp_init ())) - return -1; - - va_start (ap, cmd); vlsh = ldp_fd_to_vlsh (fd); LDBG (0, "fd %u vlsh %d, cmd %u", fd, vlsh, cmd); @@ -533,6 +527,20 @@ fcntl (int fd, int cmd, ...) #endif } + return rv; +} + +int +fcntl (int fd, int cmd, ...) +{ + va_list ap; + int rv; + + if ((errno = -ldp_init ())) + return -1; + + va_start (ap, cmd); + rv = fcntl_internal (fd, cmd, ap); va_end (ap); return rv; @@ -544,8 +552,11 @@ fcntl64 (int fd, int cmd, ...) va_list ap; int rv; + if ((errno = -ldp_init ())) + return -1; + va_start (ap, cmd); - rv = fcntl (fd, cmd, ap); + rv = fcntl_internal (fd, cmd, ap); va_end (ap); return rv; } |