aboutsummaryrefslogtreecommitdiff
path: root/core/net/socket_linux.odin
diff options
context:
space:
mode:
Diffstat (limited to 'core/net/socket_linux.odin')
-rw-r--r--core/net/socket_linux.odin8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/net/socket_linux.odin b/core/net/socket_linux.odin
index 690e09ab7..b7141e8ba 100644
--- a/core/net/socket_linux.odin
+++ b/core/net/socket_linux.odin
@@ -283,9 +283,9 @@ _set_option :: proc(s: Any_Socket, option: Socket_Option, value: any, loc := #ca
t, ok := value.(time.Duration)
if !ok do panic("set_option() value must be a time.Duration here", loc)
- nanos := time.duration_nanoseconds(t)
- timeval_value.nanoseconds = int(nanos % 1e9)
- timeval_value.seconds = (nanos - i64(timeval_value.nanoseconds)) / 1e9
+ micros := i64(time.duration_microseconds(t))
+ timeval_value.microseconds = int(micros % 1e6)
+ timeval_value.seconds = (micros - i64(timeval_value.microseconds)) / 1e6
ptr = &timeval_value
len = size_of(timeval_value)
@@ -404,4 +404,4 @@ _sockaddr_basic_to_endpoint :: proc(native_addr: ^os.SOCKADDR) -> (ep: Endpoint)
panic("native_addr is neither IP4 or IP6 address")
}
return
-} \ No newline at end of file
+}