diff options
Diffstat (limited to 'devel')
-rw-r--r-- | devel/kyua/Makefile | 1 | ||||
-rw-r--r-- | devel/kyua/files/patch-utils_datetime.cpp | 23 |
2 files changed, 24 insertions, 0 deletions
diff --git a/devel/kyua/Makefile b/devel/kyua/Makefile index 897727502a7e..19f9a03d3c0e 100644 --- a/devel/kyua/Makefile +++ b/devel/kyua/Makefile @@ -3,6 +3,7 @@ PORTNAME= kyua PORTVERSION= 0.13 PORTEPOCH= 3 +PORTREVISION= 1 CATEGORIES= devel MASTER_SITES= https://github.com/jmmv/kyua/releases/download/${PORTNAME}-${PORTVERSION}/ \ LOCAL/jmmv diff --git a/devel/kyua/files/patch-utils_datetime.cpp b/devel/kyua/files/patch-utils_datetime.cpp new file mode 100644 index 000000000000..62b1dda69b02 --- /dev/null +++ b/devel/kyua/files/patch-utils_datetime.cpp @@ -0,0 +1,23 @@ + +$FreeBSD$ + +--- utils/datetime.cpp.orig ++++ utils/datetime.cpp +@@ -590,11 +590,12 @@ + datetime::delta + datetime::timestamp::operator-(const datetime::timestamp& other) const + { +- if ((*this) < other) { +- throw std::runtime_error( +- F("Cannot subtract %s from %s as it would result in a negative " +- "datetime::delta, which are not supported") % other % (*this)); +- } ++ /* ++ * XXX-BD: gettimeofday isn't necessicarily monotonic so return the ++ * smallest non-zero delta if time went backwards. ++ */ ++ if ((*this) < other) ++ return datetime::delta::from_microseconds(1); + return datetime::delta::from_microseconds(to_microseconds() - + other.to_microseconds()); + } |