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) !...@@ -149,7 +149,8 @@ pub fn get_modpath(cachepath: string, d: zigmod.Dep, options: *CollectOptions) !
149 u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string });149 u.fail("fetch: git: {s}: {s} {s} does not exist", .{ d.path, @tagName(vers.id), vers.string });
150 }150 }
151 if (builtin.os.tag != .windows and vers.id == .commit) {151 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();
153 try pvd.deleteTree(".git");154 try pvd.deleteTree(".git");
154 }155 }
155 return pv;156 return pv;
...@@ -321,7 +322,8 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str...@@ -321,7 +322,8 @@ pub fn parse_lockfile(alloc: std.mem.Allocator, dir: std.fs.Dir) ![]const [4]str
321 var list = std.ArrayList([4]string).init(alloc);322 var list = std.ArrayList([4]string).init(alloc);
322 const max = std.math.maxInt(usize);323 const max = std.math.maxInt(usize);
323 if (!try extras.doesFileExist(dir, "zigmod.lock")) return &[_][4]string{};324 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();
325 const r = f.reader();327 const r = f.reader();
326 var i: usize = 0;328 var i: usize = 0;
327 var v: usize = 1;329 var v: usize = 1;