| Server IP : 82.208.35.60 / Your IP : 216.73.216.168 Web Server : Apache/2.4.55 (FreeBSD) OpenSSL/1.1.1q-freebsd PHP/7.3.31 System : FreeBSD server7.d2m.cz 12.4-RELEASE-p9 FreeBSD 12.4-RELEASE-p9 GENERIC amd64 User : studiokobylisy_cz ( 1008) PHP Version : 7.3.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /usr/ports/devel/kyua/files/ |
Upload File : |
--- utils/datetime.cpp.orig 2016-08-26 10:09:37 UTC
+++ utils/datetime.cpp
@@ -590,11 +590,12 @@ datetime::timestamp::operator-=(const da
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());
}