summaryrefslogtreecommitdiff
path: root/core/Plumb.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/Plumb.zig')
-rw-r--r--core/Plumb.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/Plumb.zig b/core/Plumb.zig
index f51ddace..e1b09e69 100644
--- a/core/Plumb.zig
+++ b/core/Plumb.zig
@@ -593,7 +593,7 @@ pub fn portName(p: *const Pardes, index: u8) ?[]const u8 {
/// Whether a program reads port `index` (an open of its file): the
/// authority's 9P state, asked through the tape.
fn portRead(p: *Pardes, index: u8) bool {
- for (&p.fs.opens) |*o| if (o.node != 0 and o.what == .port and o.what.port.index == index) return true;
+ for (p.fs.opens[0..p.fs.opens_len]) |*o| if (o.node != 0 and o.what == .port and o.what.port.index == index) return true;
return false;
}
@@ -611,7 +611,7 @@ fn enqueue(p: *Pardes, q: *events.Queue, lead: []const u8, m: *const Msg) bool {
/// A copy of `m` to every reader of port `index` (plumber(4)'s queuesend:
/// every fid open when it was sent), each read held for one answered.
fn fanOut(p: *Pardes, index: u8, m: *const Msg) void {
- for (&p.fs.opens) |*o| if (o.node != 0 and o.what == .port and o.what.port.index == index) {
+ for (p.fs.opens[0..p.fs.opens_len]) |*o| if (o.node != 0 and o.what == .port and o.what.port.index == index) {
if (!enqueue(p, &o.what.port.queue, "", m)) {
var said: Kind.Buf(160) = .{};
events.notePath(p, "err -", said.print("plumb/{s}: a message of {d} bytes is over a reader's {d} KiB, not sent to it", .{ portName(p, index).?, m.data.len, events.queue_cap / 1024 }));