Change type of Timeval.tv_sec to posix.Time (#7646)

This commit is contained in:
Oscar Nihlgård 2018-04-18 21:24:28 +02:00 • committed by Andreas Rumpf
commit fdf1d12380
9 changed files with 28 additions and 15 deletions

View file

@ -1660,7 +1660,7 @@ proc setLastModificationTime*(file: string, t: times.Time) =
## Sets the `file`'s last modification time. `OSError` is raised in case of
## an error.
when defined(posix):
let unixt = t.toUnix.int
let unixt = posix.Time(t.toUnix)
var timevals = [Timeval(tv_sec: unixt), Timeval(tv_sec: unixt)] # [last access, last modification]
if utimes(file, timevals.addr) != 0: raiseOSError(osLastError())
else: