aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/archive.cc
diff options
context:
space:
mode:
authorkvtb <76634406+kvtb@users.noreply.github.com>2021-10-02 21:04:01 +0000
committerGitHub <noreply@github.com>2021-10-02 21:04:01 +0000
commit638c73776aef397ff04209bb38279c72f0b85136 (patch)
treef6a83f15329a06d98e149829b5e0f434652b5c22 /src/libutil/archive.cc
parentaade43ffca1071c7bc376cedfb4beca0eb181bab (diff)
fix creation of NAR files >4GB on 32-bit platforms
`size_t` is 32-bit on 32-bit platforms, while the file size can be bigger
Diffstat (limited to 'src/libutil/archive.cc')
-rw-r--r--src/libutil/archive.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/archive.cc b/src/libutil/archive.cc
index ed0eb2fb5..d78ec2b93 100644
--- a/src/libutil/archive.cc
+++ b/src/libutil/archive.cc
@@ -42,7 +42,7 @@ static string caseHackSuffix = "~nix~case~hack~";
PathFilter defaultPathFilter = [](const Path &) { return true; };
-static void dumpContents(const Path & path, size_t size,
+static void dumpContents(const Path & path, off_t size,
Sink & sink)
{
sink << "contents" << size;
@@ -76,7 +76,7 @@ static void dump(const Path & path, Sink & sink, PathFilter & filter)
sink << "type" << "regular";
if (st.st_mode & S_IXUSR)
sink << "executable" << "";
- dumpContents(path, (size_t) st.st_size, sink);
+ dumpContents(path, st.st_size, sink);
}
else if (S_ISDIR(st.st_mode)) {