X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fvcom.c;fp=extras%2Fvcl-ldpreload%2Fsrc%2Flibvcl-ldpreload%2Fvcom.c;h=6d98fdb75c0518e7132856a6006c9665c8ea7b87;hb=5c7cf1cc5358d137160be1619981e7eea9a7402f;hp=6ddb245b421bdef6ce6e90de9b40899f8abd8d01;hpb=4c151b5fa13312639b0a5ef0d0efb1866bf4ed5e;p=vpp.git diff --git a/extras/vcl-ldpreload/src/libvcl-ldpreload/vcom.c b/src/vcl/vcom.c similarity index 99% rename from extras/vcl-ldpreload/src/libvcl-ldpreload/vcom.c rename to src/vcl/vcom.c index 6ddb245b421..6d98fdb75c0 100644 --- a/extras/vcl-ldpreload/src/libvcl-ldpreload/vcom.c +++ b/src/vcl/vcom.c @@ -21,12 +21,12 @@ #include #include -#include -#include +#include +#include #include -#include -#include +#include +#include /* GCC have printf type attribute check. */ #ifdef HAVE_FUNCTION_ATTRIBUTE_FORMAT @@ -889,11 +889,13 @@ typedef __u64 timeu64_t; #define TIME_T_MAX (time_t)((1UL << ((sizeof(time_t) << 3) - 1)) - 1) +#ifdef VCOM_USE_TIMESPEC_EQUAL static inline int timespec_equal (const struct timespec *a, const struct timespec *b) { return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); } +#endif /* * lhs < rhs: return <0 @@ -910,6 +912,7 @@ timespec_compare (const struct timespec *lhs, const struct timespec *rhs) return lhs->tv_nsec - rhs->tv_nsec; } +#ifdef VCOM_USE_TIMEVAL_COMPARE static inline int timeval_compare (const struct timeval *lhs, const struct timeval *rhs) { @@ -919,11 +922,11 @@ timeval_compare (const struct timeval *lhs, const struct timeval *rhs) return 1; return lhs->tv_usec - rhs->tv_usec; } +#endif extern void set_normalized_timespec (struct timespec *ts, time_t sec, s64 nsec); - static inline struct timespec timespec_add (struct timespec lhs, struct timespec rhs) { @@ -3020,7 +3023,7 @@ vcom_poll (struct pollfd *__fds, nfds_t __nfds, int __timeout) rv = -errno; goto poll_done; } - if (__nfds >= nofile_limit.rlim_cur || __nfds < 0) + if (__nfds >= nofile_limit.rlim_cur) { rv = -EINVAL; goto poll_done;