liminix

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit b84a6e0aa53fb0e17eabade7dd624b2090655eb0
parent d729709869beeef9700a192a6ed81b4b48460c18
Author: Daniel Barlow <dan@telent.net>
Date:   Wed, 15 Feb 2023 19:49:16 +0000

fix poll() to not mutate its parameter

Diffstat:
Mpkgs/tufted/tftp.lua | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pkgs/tufted/tftp.lua b/pkgs/tufted/tftp.lua @@ -84,12 +84,14 @@ local poll = (function() if timedout then return nil end local ready = {} for _, fd in ipairs(readable) do - fds[fd].readable = true + ready[fd] = ready[fd] or { fd = fd } + ready[fd].readable = true end for _, fd in ipairs(writeable) do - fds[fd].writeable = true + ready[fd] = ready[fd] or { fd = fd } + ready[fd].writeable = true end - return fds + return ready end end)()