posix: Use std::trunc() from <cmath> instead of trunc()

Change-Id: Ief90846020a4fea46e5008e8ddff5825d23ce8b9
Reviewed-on: https://chromium-review.googlesource.com/543216
Reviewed-by: Joshua Peraza <jperaza@chromium.org>
This commit is contained in:
Mark Mentovai 2017-06-21 10:46:34 -04:00
parent bf52da0f1b
commit d2d10d1dc8

View File

@ -66,7 +66,7 @@ bool Semaphore::TimedWait(double seconds) {
}
timespec timeout;
timeout.tv_sec = seconds;
timeout.tv_nsec = (seconds - trunc(seconds)) * 1E9;
timeout.tv_nsec = (seconds - std::trunc(seconds)) * 1E9;
AddTimespec(current_time, timeout, &timeout);
int rv = HANDLE_EINTR(sem_timedwait(&semaphore_, &timeout));