change time_monotonic_ms() from time_t to int64_t

time_monotonic_ms values did wrap every ~24 days, leading to problems
in code that did not cope with that. Instead of fixing all places where
relative comparisons with time_monotonic_ms() are made, just use a
bigger datatype. Convert all users to the new type.
This commit is contained in:
Stefan Seyfried
2017-09-23 21:35:01 +02:00
committed by Jacek Jendrzej
parent ea30b22119
commit 99c8168d2c
8 changed files with 28 additions and 24 deletions

View File

@@ -133,14 +133,14 @@ void CShellWindow::exec()
fds.events = POLLIN | POLLHUP | POLLERR;
fcntl(fds.fd, F_SETFL, fcntl(fds.fd, F_GETFL, 0) | O_NONBLOCK);
time_t lastPaint = time_monotonic_ms();
int64_t lastPaint = time_monotonic_ms();
bool ok = true, nlseen = false, dirty = false, incomplete = false;
char output[1024];
std::string txt = "";
std::string line = "";
do {
time_t now;
int64_t now;
fds.revents = 0;
int r = poll(&fds, 1, 300);
if (r > 0) {