mirror of
https://github.com/ziglang/zig.git
synced 2026-02-12 12:27:41 +00:00
std: Close dangling fd on error
This patch was already submitted for openFileZ, createFileZ was left unpatched.
This commit is contained in:
parent
0d4f05bb8a
commit
26d20e39fc
@ -892,6 +892,7 @@ pub const Dir = struct {
|
||||
try std.event.Loop.instance.?.openatZ(self.fd, sub_path_c, os_flags, flags.mode)
|
||||
else
|
||||
try os.openatZ(self.fd, sub_path_c, os_flags, flags.mode);
|
||||
errdefer os.close(fd);
|
||||
|
||||
if (!has_flock_open_flags and flags.lock != .None) {
|
||||
// TODO: integrate async I/O
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user