| author | |
| committer | |
| log | f780a6b024f25838560cce6e0bd93c808e09457b |
| tree | 88534584c410460f73b4a8b9f5abd8a9db063c4c |
| parent | d8bdfd8192fb43ca8f6abd223396a4073e369499 |
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'`.1 files changed, 1 insertions(+), 0 deletions(-)
lib/std/fs.zig+1| ... | ... | @@ -1397,6 +1397,7 @@ pub const Dir = struct { |
| 1397 | 1397 | .capable_io_mode = std.io.default_mode, |
| 1398 | 1398 | .intended_io_mode = flags.intended_io_mode, |
| 1399 | 1399 | }; |
| 1400 | errdefer file.close(); | |
| 1400 | 1401 | var io: w.IO_STATUS_BLOCK = undefined; |
| 1401 | 1402 | const range_off: w.LARGE_INTEGER = 0; |
| 1402 | 1403 | const range_len: w.LARGE_INTEGER = 1; |