Change type of Timeval.tv_sec to posix.Time (#7646)
This commit is contained in:
parent
b9cafe5752
commit
fdf1d12380
9 changed files with 28 additions and 15 deletions
|
|
@ -953,8 +953,12 @@ when defined(ssl):
|
|||
proc timeValFromMilliseconds(timeout = 500): Timeval =
|
||||
if timeout != -1:
|
||||
var seconds = timeout div 1000
|
||||
result.tv_sec = seconds.int32
|
||||
result.tv_usec = ((timeout - seconds * 1000) * 1000).int32
|
||||
when defined(posix):
|
||||
result.tv_sec = seconds.Time
|
||||
result.tv_usec = ((timeout - seconds * 1000) * 1000).Suseconds
|
||||
else:
|
||||
result.tv_sec = seconds.int32
|
||||
result.tv_usec = ((timeout - seconds * 1000) * 1000).int32
|
||||
|
||||
proc createFdSet(fd: var TFdSet, s: seq[Socket], m: var int) =
|
||||
FD_ZERO(fd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue