From 3fd01b171a74d28dc8e48b9ee5f2d0e9a3915fb8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Feb 2014 23:17:53 +0100 Subject: Set up a minimal /dev in chroots Not bind-mounting the /dev from the host also solves the problem with /dev/shm being a symlink to something not in the chroot. --- src/nix-env/profiles.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc index c327993594e8..f7b306890d4c 100644 --- a/src/nix-env/profiles.cc +++ b/src/nix-env/profiles.cc @@ -118,8 +118,7 @@ void switchLink(Path link, Path target) if (dirOf(target) == dirOf(link)) target = baseNameOf(target); Path tmp = canonPath(dirOf(link) + "/.new_" + baseNameOf(link)); - if (symlink(target.c_str(), tmp.c_str()) != 0) - throw SysError(format("creating symlink `%1%'") % tmp); + createSymlink(target, tmp); /* The rename() system call is supposed to be essentially atomic on Unix. That is, if we have links `current -> X' and `new_current -> Y', and we rename new_current to current, a -- cgit 1.4.1