Avoid long double timestamps in redbean

This commit is contained in:
Justine Tunney 2022-08-05 19:24:05 -07:00
parent 8d9ac3da50
commit acdf591833
17 changed files with 431 additions and 77 deletions

View file

@ -24,8 +24,8 @@
struct timespec _timespec_add(struct timespec x, struct timespec y) {
x.tv_sec += y.tv_sec;
x.tv_nsec += y.tv_nsec;
if (x.tv_nsec >= 10000000000) {
x.tv_nsec -= 10000000000;
if (x.tv_nsec >= 1000000000) {
x.tv_nsec -= 1000000000;
x.tv_sec += 1;
}
return x;