mirror of
https://github.com/ziglang/zig.git
synced 2025-12-16 03:03:09 +00:00
std: further windows resource fix
addition to #15450 createFileW does not account for failure on `LockFile`. This can result in a file handle not being closed on failure which can be seen on test such as `fs.test.'open file with exclusive nonblocking lock twice'`.
This commit is contained in:
parent
d8bdfd8192
commit
f780a6b024
@ -1397,6 +1397,7 @@ pub const Dir = struct {
|
|||||||
.capable_io_mode = std.io.default_mode,
|
.capable_io_mode = std.io.default_mode,
|
||||||
.intended_io_mode = flags.intended_io_mode,
|
.intended_io_mode = flags.intended_io_mode,
|
||||||
};
|
};
|
||||||
|
errdefer file.close();
|
||||||
var io: w.IO_STATUS_BLOCK = undefined;
|
var io: w.IO_STATUS_BLOCK = undefined;
|
||||||
const range_off: w.LARGE_INTEGER = 0;
|
const range_off: w.LARGE_INTEGER = 0;
|
||||||
const range_len: w.LARGE_INTEGER = 1;
|
const range_len: w.LARGE_INTEGER = 1;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user