From 56253bb08fef60f4768ebb2ca013135b0dbf5df3 Mon Sep 17 00:00:00 2001 From: Will Dietz Date: Tue, 6 Mar 2018 17:34:44 -0600 Subject: rand() -> random(), since we use srandom(). rand() requires we call srand() instead, but might as well use random(). --- src/libstore/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstore/build.cc') diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 1d611ffba..47a905c81 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1458,7 +1458,7 @@ void replaceValidPath(const Path & storePath, const Path tmpPath) tmpPath (the replacement), so we have to move it out of the way first. We'd better not be interrupted here, because if we're repairing (say) Glibc, we end up with a broken system. */ - Path oldPath = (format("%1%.old-%2%-%3%") % storePath % getpid() % rand()).str(); + Path oldPath = (format("%1%.old-%2%-%3%") % storePath % getpid() % random()).str(); if (pathExists(storePath)) rename(storePath.c_str(), oldPath.c_str()); if (rename(tmpPath.c_str(), storePath.c_str()) == -1) -- cgit v1.2.3