1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-25 00:51:21 +00:00

net/owamp: Unconditionally define a private timespecadd

net/owamp assumes that if timespecadd is defined, it's identical
to the two-argument version found in the FreeBSD kernel.  However,
the three argument version found in NetBSD and OpenBSD is actually
more common.  An upcoming commit to head will replace FreeBSD's
version with the NetBSD version.  So net/owamp shouldn't assume
that if FreeBSD defines timespecadd, it's defining the 2-argument
version.

PR:		230059
Submitted by:	asomers
This commit is contained in:
Kurt Jaeger 2018-07-26 18:17:30 +00:00
parent 580db765b2
commit e011e2dcbb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=475393

View File

@ -0,0 +1,49 @@
--- owamp/owamp.h.orig 2012-03-27 02:23:05 UTC
+++ owamp/owamp.h
@@ -1635,14 +1635,13 @@ OWPTestDiskspace(
#define timespecisset(tvp) ((tvp)->tv_sec || (tvp)->tv_nsec)
#endif
-#ifndef timespeccmp
+#undef timespeccmp
#define timespeccmp(tvp, uvp, cmp) \
(((tvp)->tv_sec == (uvp)->tv_sec) ? \
((tvp)->tv_nsec cmp (uvp)->tv_nsec) : \
((tvp)->tv_sec cmp (uvp)->tv_sec))
-#endif
-#ifndef timespecadd
+#undef timespecadd
#define timespecadd(vvp, uvp) \
do { \
(vvp)->tv_sec += (uvp)->tv_sec; \
@@ -1652,9 +1651,8 @@ OWPTestDiskspace(
(vvp)->tv_nsec -= 1000000000; \
} \
} while (0)
-#endif
-#ifndef timespecsub
+#undef timespecsub
#define timespecsub(vvp, uvp) \
do { \
(vvp)->tv_sec -= (uvp)->tv_sec; \
@@ -1664,9 +1662,8 @@ OWPTestDiskspace(
(vvp)->tv_nsec += 1000000000; \
} \
} while (0)
-#endif
-#ifndef timespecdiff
+#undef timespecdiff
#define timespecdiff(vvp,uvp) \
do { \
struct timespec ts1_,ts2_; \
@@ -1680,7 +1677,6 @@ OWPTestDiskspace(
timespecsub(&ts1_,&ts2_); \
*vvp = ts1_; \
} while(0)
-#endif
extern OWPNum64
OWPGetRTTBound(