We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a2fe81a commit d8bdfd8Copy full SHA for d8bdfd8
lib/std/fs.zig
@@ -1236,6 +1236,7 @@ pub const Dir = struct {
1236
.capable_io_mode = std.io.default_mode,
1237
.intended_io_mode = flags.intended_io_mode,
1238
};
1239
+ errdefer file.close();
1240
var io: w.IO_STATUS_BLOCK = undefined;
1241
const range_off: w.LARGE_INTEGER = 0;
1242
const range_len: w.LARGE_INTEGER = 1;
lib/std/os/test.zig
@@ -1101,6 +1101,8 @@ test "isatty" {
1101
defer tmp.cleanup();
1102
1103
var file = try tmp.dir.createFile("foo", .{});
1104
+ defer file.close();
1105
+
1106
try expectEqual(os.isatty(file.handle), false);
1107
}
1108
0 commit comments