Author: eelco
Date: 2010-06-14 08:34:48 +0000 (Mon, 14 Jun 2010)
New Revision: 22253

You can view the changes in this commit at:
   https://svn.nixos.org/viewvc/nix?rev=22253&view=rev

Modified:
   nix/trunk/src/libstore/local-store.cc

Log:
* In importPath() and exportPath(), lock the temporary directory to
  prevent it from being deleted by the garbage collector.


Changes:

Modified: nix/trunk/src/libstore/local-store.cc
===================================================================
--- nix/trunk/src/libstore/local-store.cc       2010-06-14 08:01:38 UTC (rev 
22252)
+++ nix/trunk/src/libstore/local-store.cc       2010-06-14 08:34:48 UTC (rev 
22253)
@@ -873,6 +873,8 @@
         writeInt(1, hashAndWriteSink);
         
         Path tmpDir = createTempDir();
+        PathLocks tmpDirLock(singleton<PathSet, Path>(tmpDir));
+        tmpDirLock.setDeletion(true);
         AutoDelete delTmp(tmpDir);
         Path hashFile = tmpDir + "/hash";
         writeFile(hashFile, printHash(hash));
@@ -922,6 +924,8 @@
        store path follows the archive data proper), and besides, we
        don't know yet whether the signature is valid. */
     Path tmpDir = createTempDir(nixStore);
+    PathLocks tmpDirLock(singleton<PathSet, Path>(tmpDir));
+    tmpDirLock.setDeletion(true);
     AutoDelete delTmp(tmpDir); /* !!! could be GC'ed! */
     Path unpacked = tmpDir + "/unpacked";
 

_______________________________________________
nix-commits mailing list
[email protected]
http://mail.cs.uu.nl/mailman/listinfo/nix-commits

Reply via email to