commit 048efff32db858483691b738bf3626ad48d56289
parent a83568fc4b19c53123a10d37576a5dfb357cde78
Author: Drew DeVault <sir@cmpwn.com>
Date: Tue, 19 Oct 2021 13:07:28 +0200
iobus: fix bug with {un,}register_file
Signed-off-by: Drew DeVault <sir@cmpwn.com>
Diffstat:
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/iobus/io_uring/bus.ha b/iobus/io_uring/bus.ha
@@ -90,7 +90,7 @@ export fn register_file(bus: *bus, file: io::file) registered_file = {
let updates = [
io_uring::files_update {
offs = bus.lastfd: u32,
- fds = &bus.fdset[0],
+ fds = &bus.fdset[bus.lastfd],
},
];
bus.fdset[bus.lastfd] = file;
@@ -111,7 +111,7 @@ export fn unregister_file(bus: *bus, file: file) void = {
let updates = [
io_uring::files_update {
offs = reg: u32,
- fds = &bus.fdset[0],
+ fds = &bus.fdset[reg],
},
];
bus.fdset[reg] = -1;