From 0e7109cab21f0b028425ca6715b23c1c1b2c025b Mon Sep 17 00:00:00 2001 From: Colin Davidson Date: Mon, 31 Oct 2022 06:08:18 -0700 Subject: [PATCH] terminate read if we read EOF --- core/os/os_darwin.odin | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/os/os_darwin.odin b/core/os/os_darwin.odin index ac7376752..0a7d7e1fb 100644 --- a/core/os/os_darwin.odin +++ b/core/os/os_darwin.odin @@ -404,6 +404,9 @@ read :: proc(fd: Handle, data: []u8) -> (int, Errno) { if bytes_read == -1 { return bytes_read_total, 1 } + if bytes_read == 0 { + break + } bytes_read_total += bytes_read }