diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-06-21 12:49:18 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-06-21 12:53:52 +0200 |
commit | 29ccb2e9697ee2184012dd13854e487928ae4441 (patch) | |
tree | c06c8b6f8a8a86a4bb39323e3b4d27bdd29562c7 /src/libexpr/primops/fetchGit.cc | |
parent | d0a769cb061a13ad880c76e5ea69a76150439853 (diff) |
Fix 32-bit overflow with --no-net
--no-net causes tarballTtl to be set to the largest 32-bit integer,
which causes comparison like 'time + tarballTtl < other_time' to
fail on 32-bit systems. So cast them to 64-bit first.
https://hydra.nixos.org/build/95076624
Diffstat (limited to 'src/libexpr/primops/fetchGit.cc')
-rw-r--r-- | src/libexpr/primops/fetchGit.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libexpr/primops/fetchGit.cc b/src/libexpr/primops/fetchGit.cc index 10f6b6f72..f0f5b2a51 100644 --- a/src/libexpr/primops/fetchGit.cc +++ b/src/libexpr/primops/fetchGit.cc @@ -135,7 +135,7 @@ GitInfo exportGit(ref<Store> store, std::string uri, git fetch to update the local ref to the remote ref. */ struct stat st; doFetch = stat(localRefFile.c_str(), &st) != 0 || - st.st_mtime + settings.tarballTtl <= now; + (uint64_t) st.st_mtime + settings.tarballTtl <= (uint64_t) now; } if (doFetch) { |