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:
xEgoist 2023-04-25 11:21:52 -05:00 committed by Andrew Kelley
parent d8bdfd8192
commit f780a6b024

View File

@ -1397,6 +1397,7 @@ pub const Dir = struct {
.capable_io_mode = std.io.default_mode,
.intended_io_mode = flags.intended_io_mode,
};
errdefer file.close();
var io: w.IO_STATUS_BLOCK = undefined;
const range_off: w.LARGE_INTEGER = 0;
const range_len: w.LARGE_INTEGER = 1;