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
|
|
@ -616,8 +616,12 @@ proc setBlocking*(s: SocketHandle, blocking: bool) =
|
|||
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 useWinVersion:
|
||||
result.tv_sec = seconds.int32
|
||||
result.tv_usec = ((timeout - seconds * 1000) * 1000).int32
|
||||
else:
|
||||
result.tv_sec = seconds.Time
|
||||
result.tv_usec = ((timeout - seconds * 1000) * 1000).Suseconds
|
||||
|
||||
proc createFdSet(fd: var TFdSet, s: seq[SocketHandle], m: var int) =
|
||||
FD_ZERO(fd)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue