diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-05 19:08:37 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-23 22:15:07 -0800 |
| commit | aafddc2ea13e40a8262d9378aeca2e097a37ac03 (patch) | |
| tree | 46770e51147a635a43c2e7356e62064466b51c34 /lib/std/os/linux/test.zig | |
| parent | eab354b2f5d7242c036523394023e9824be7eca9 (diff) | |
| download | zig-aafddc2ea13e40a8262d9378aeca2e097a37ac03.tar.gz zig-aafddc2ea13e40a8262d9378aeca2e097a37ac03.zip | |
update all occurrences of close() to close(io)
Diffstat (limited to 'lib/std/os/linux/test.zig')
| -rw-r--r-- | lib/std/os/linux/test.zig | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/std/os/linux/test.zig b/lib/std/os/linux/test.zig index 7399907477..39606ddfac 100644 --- a/lib/std/os/linux/test.zig +++ b/lib/std/os/linux/test.zig @@ -12,12 +12,14 @@ const fs = std.fs; test "fallocate" { if (builtin.cpu.arch.isMIPS64() and (builtin.abi == .gnuabin32 or builtin.abi == .muslabin32)) return error.SkipZigTest; // https://codeberg.org/ziglang/zig/issues/30220 + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const path = "test_fallocate"; const file = try tmp.dir.createFile(path, .{ .truncate = true, .mode = 0o666 }); - defer file.close(); + defer file.close(io); try expect((try file.stat()).size == 0); @@ -77,12 +79,14 @@ test "timer" { } test "statx" { + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const tmp_file_name = "just_a_temporary_file.txt"; var file = try tmp.dir.createFile(tmp_file_name, .{}); - defer file.close(); + defer file.close(io); var buf: linux.Statx = undefined; switch (linux.errno(linux.statx(file.handle, "", linux.AT.EMPTY_PATH, .BASIC_STATS, &buf))) { @@ -111,12 +115,14 @@ test "user and group ids" { } test "fadvise" { + const io = std.testing.io; + var tmp = std.testing.tmpDir(.{}); defer tmp.cleanup(); const tmp_file_name = "temp_posix_fadvise.txt"; var file = try tmp.dir.createFile(tmp_file_name, .{}); - defer file.close(); + defer file.close(io); var buf: [2048]u8 = undefined; try file.writeAll(&buf); |
