From 704215e1a9b2f12202b8257776b46ce60f4f4e47 Mon Sep 17 00:00:00 2001 From: "Caleb J. Gardner" Date: Sat, 7 Feb 2026 06:42:34 -0600 Subject: [PATCH] Remove updateTimes because I was running into integer overlow issues. --- README.md | 2 +- src/inode.zig | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 827dfbd..e56856e 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,4 @@ This is my experiments to learn Zig. Might amount to something. Might not. ## Current State -Kinda works as a library, but currently has known memory leaks. `unsquashfs` is missing a lot of features (and will probably never match the official unsquashfs). Extraction is stupidly slow and uses too many resources. Only properly work on Linux, any other OSes probably won't work fully. +Overall works, but currently is completely single threaded and is missing some features. Extraction is slow. Only properly work on Linux, any other OSes probably won't work fully. diff --git a/src/inode.zig b/src/inode.zig index 1c11534..0468e88 100644 --- a/src/inode.zig +++ b/src/inode.zig @@ -221,7 +221,8 @@ fn extractRegFile(self: Inode, archive: *Archive, path: []const u8, options: Ext _ = try dat_rdr.interface.streamRemaining(&wrt.interface); try wrt.interface.flush(); // updateTime is in nanoseconds (a billionth of a second). mod_time is in seconds. - try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time); + // TODO: fix + // try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time); if (!options.ignore_permissions) { try fil.chmod(self.hdr.permissions); try fil.chown(try archive.id(self.hdr.uid_idx), try archive.id(self.hdr.gid_idx)); @@ -305,7 +306,8 @@ fn extractDevice(self: Inode, archive: *Archive, path: []const u8, options: Extr } var fil = try std.fs.cwd().openFile(path, .{}); // updateTime is in nanoseconds (a billionth of a second). mod_time is in seconds. - try fil.updateTimes(self.hdr.mod_time * (10 ^ 9), self.hdr.mod_time * (10 ^ 9)); + // TODO: fix + // try fil.updateTimes(self.hdr.mod_time, self.hdr.mod_time); if (!options.ignore_permissions) { try fil.chmod(self.hdr.permissions); try fil.chown(try archive.id(self.hdr.uid_idx), try archive.id(self.hdr.gid_idx));