authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-23 23:10:57 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-11-23 23:10:57 -08:00
loga9863df0dedb0f59bbabcbf3d13f859e33c265a2
tree6b2e3e5d5aaae39dafb8835480938a59579f9810
parent941ad7c971be96e2b85a683760f0a7a3a513c202

close some file descriptors


1 files changed, 4 insertions(+), 2 deletions(-)

src/common.zig+4-2
......@@ -149,7 +149,8 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !
149149 u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string });
150150 }
151151 if (builtin.os.tag != .windows and vers.id == .commit) {
152 const pvd = try std.fs.cwd().openDir(pv, .{});
152 var pvd = try std.fs.cwd().openDir(pv, .{});
153 defer pvd.close();
153154 try pvd.deleteTree(".git");
154155 }
155156 return pv;
......@@ -321,7 +322,8 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str
321322 var list = std.ArrayList([4]string).init(alloc);
322323 const max = std.math.maxInt(usize);
323324 if (!try extras.doesFileExist(dir, "zigmod.lock")) return &[_][4]string{};
324 const f = try dir.openFile("zigmod.lock", .{});
325 var f = try dir.openFile("zigmod.lock", .{});
326 defer f.close();
325327 const r = f.reader();
326328 var i: usize = 0;
327329 var v: usize = 1;